我正在使用 CKEditor 4,
为了支持RTL 语言(如波斯语),我需要用dir
将其内容包装在div
中属性设置为 rtl
:
<div dir="rtl">
<!-- Content goes here -->
</div>
如有任何帮助,我们将不胜感激。
最佳答案
使用editor#getData修改输出内容的事件:
CKEDITOR.replace( 'yourInstanceHere', {
on: {
getData: function( evt ) {
evt.data.dataValue = '<div dir="rtl">' + evt.data.dataValue + '</div>';
}
}
} );
关于javascript - 如何将 CKEditor 内容包装在一个 div 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17905318/