Preventing CKEditor from adding 'data-cke-saved' and converting &lt

你。 提交于 2019-12-23 17:09:41

问题


I have a jQuery implementation of CKEditor. We frequently add HTML markup to the 'title' attribute of an A tag using the dialog. However when we do this, it converts the HTML code so that it is parsed as text. We need the code to stay in the exact form that it was entered in, instead of it placing 'data-cke-saved' everywhere, and converting the <> to &lt and &gt.

I have tried turning entities off in the config, but it doesn't seem to work.

Can anyone help?

Thanks.


回答1:


SRC: http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.protectedSource

List of regular expressions to be executed on input HTML, indicating HTML source code that when matched, must not be available in the WYSIWYG mode for editing.

 
config.protectedSource.push( /<\?[\s\S]*?\?>/g );   // PHP code

config.protectedSource.push( /<%[\s\S]*?%>/g ); // ASP code

config.protectedSource.push( /(]+>[\s|\S]*?</asp:[^>]+>)|(]+/>)/gi ); // ASP.Net code

Default Value: [] (empty array)

来源:https://stackoverflow.com/questions/6177667/preventing-ckeditor-from-adding-data-cke-saved-and-converting-lt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!