问题
I dont want the ckeditor to escape text written. I use the editor such that customers can write their their own mailtemplates, and I give them code snippets they can paste in the around in the text in the editor to merge in dynamic data, ala ${customer.name}.
The text is then persisted to database and retrieved again other places in code and filled with data through Freemarker. And here the problem amerge - Freemarker uses <
and >
characters, but the ckeditor escapes them. How can I configure ckeditor to not do this?
thanks in advance
回答1:
CKeditor is creating HTML, so the < and > characters are reserved, and if it wasn't escaping them, the text wouldn't display.
Personally, I would put a translator between what the browser sends to the server and what is being sent to FreeMarker, either when the template is stored, or when it's rendered. If your users are familiar with FreeMarker, continue to allow them to use > and <, but then unescape them before trying to render them.
来源:https://stackoverflow.com/questions/6949938/ckeditor-escapes-all-text-how-can-i-prevent-it-from-doing-so