此示例显示如何配置CKEditor以输出有效
XHTML 1.1 码。
Deprecated elements (<font>
, <u>
) or attributes
(size
, face
) will be replaced with XHTML compliant 码。
要添加输出有效XHTML代码的CKEditor实例,请使用标准加载编辑器 JavaScript调用并定义CKEditor功能以使用符合XHTML的元素和样式。
下面是配置代码的片段; 检查此页面的来源 full definition:
CKEDITOR.replace( 'textarea_id', { contentsCss: 'assets/outputxhtml.css', coreStyles_bold: { element: 'span', attributes: { 'class': 'Bold' } }, coreStyles_italic: { element: 'span', attributes: { 'class': 'Italic' } }, ... });