阻止CkEditor对源代码视图中的属性值进行编码



我试图通过在源代码视图中键入é,在div标记的自定义属性值中包含法国口音,但是,当我转到编辑器视图并返回源代码视图时,é会被转换为一个é。我希望仍然能够在常规编辑器中键入é,并在源代码中看到é,但如果我修改了源代码并将é添加到其中一个属性中,我希望ckEditor保持原样。

示例:

目前,我有

<div section="section">&eacute;couter<div>

显示在源代码视图中,"écouter"显示在常规视图中。如果我转到源代码,并将section="section"更改为section="s&eacute;ction",ckEditor会将其切换为section="séction",这不是我想要的。

由于我正在直接修改源,我不希望ckeditor解码,我希望能够将其保存为

<div section="s&eacute;ction">&eacute;couter<div>

而不是

<div section="séction">&eacute;couter<div>

请告知。

如果您愿意,可以使用:

CKEDITOR.config.entities_processNumerical = 'force'; //Whether to convert all remaining characters not included in the ASCII character table to their relative decimal numeric representation of HTML entity. When set to force, it will convert all entities into this format. For example : & # 27721;& # 35821;."

它将转换为:60;div section=&#34;s&#233;动作&#34&#62&#233;couter60;div&#62;

完整代码:<;div section=";sé;动作">é;couter<;div>;

最新更新