I have a small editor in a form, I can save the content to the database. I can load it back, the newlines, the bold and italic styling is preserved, unfortunately the underline is not preserved…
I don’t know what’s wrong and where the problem lies.
Of interest, perhaps, the change of tagging happening in the connector.
[code]DataProcessor object initialized
2_noteText => test bold.
test italic.
test underline.
Row data [2]
noteText => test bold.
test italic.
test underline.
!nativeeditor_status => updated
UPDATE entrynotes SET noteText='test bold.
test italic.
test underline.
'
WHERE id='2'
Edit operation finished
0 => action:updated; sid:2; tid:2;[/code]
When I read back the text on the client, I see that span. I changed it into a in a onBeforeDataLoad() but to no avail.
By default connector filter content to prevent XSS
You can disable it with next line of code ( place it just before connector’s initialization )
ConnectorSecurity::$xss = DHX_SECURITY_TRUSTED;
docs.dhtmlx.com/connector__php__ … urity.html
Ok, I will try it, but I suppose you noticed that bold and italic were not filtered and roundtripped fine.
Also I was already using ConnectorSecurity::$xss = DHX_SECURITY_SAFEHTML;
Ok, it worked, thanks. I suppose I was missing some information about the difference between ConnectorSecurity::$xss = DHX_SECURITY_TRUSTED; (your very useful suggestion) and ConnectorSecurity::$xss = DHX_SECURITY_SAFEHTML; (which i had).
DHX_SECURITY_SAFEHTML allows to use HTML tags but it will remove most attributes, which is causing the problem in your case.