如何在 CKEditor 4.4 中添加源代码换行符
How to add source line breaks in CKEditor 4.4
我是 运行 CKEditor 4.4.7,默认情况下,HTML 源代码没有换行符,也没有制表符。
我已尝试根据 HTML Output Formatting 配置源格式,但此文档似乎已过时。 editor.dataProcessor.writer
的控制台日志显示它没有 lineBreaksChars
属性(并且添加一个没有任何作用),也没有 .setRules
方法。
有没有办法在 4.4.7 版的 HTML 输出中换行?
您只需要htmlwriter plugin. You can either download a different build of CKEditor or download the plugin and add it manually with config.extraPlugins = 'htmlwriter'
。
参见JSFiddle。
我是 运行 CKEditor 4.4.7,默认情况下,HTML 源代码没有换行符,也没有制表符。
我已尝试根据 HTML Output Formatting 配置源格式,但此文档似乎已过时。 editor.dataProcessor.writer
的控制台日志显示它没有 lineBreaksChars
属性(并且添加一个没有任何作用),也没有 .setRules
方法。
有没有办法在 4.4.7 版的 HTML 输出中换行?
您只需要htmlwriter plugin. You can either download a different build of CKEditor or download the plugin and add it manually with config.extraPlugins = 'htmlwriter'
。
参见JSFiddle。