我正在使用Drupal 7和CKEditor 4.2并希望允许某些自定义内容。所以我跟着this post并将以下配置添加到sites / all / modules / ckeditor / ckeditor / config.js:
CKEDITOR.editorConfig = function( config ) {
...
config.extraAllowedContent = 'pre (!command-line); span (!command); span(!comment); span(!output); em';
};
但是,我在纯文本模式下通过CKEditor输入的内容如下:
<pre class="command-line">
<span class="command"> ... <em>...</em></span>
<span class="comment">...</span>
<span class="output">...</span>
</pre>
我也尝试过使用allowedContent而不是extraAllowedContent而没有任何影响。无论哪种情况,都要清理格式。也许我的配置被CKEditor忽略了,或者它本身就错了?