如何在div中包装CKEditor内容?

Sup*_*net 3 html javascript jquery ckeditor

我正在使用CKEditor 4,

为了支持RTL语言(比如波斯语),我需要将其内容包含在一个divwith dir属性设置为rtl:

<div dir="rtl">
    <!-- Content goes here -->
</div>
Run Code Online (Sandbox Code Playgroud)

任何帮助,将不胜感激.

ole*_*leq 5

使用editor#getData事件修改输出的内容:

CKEDITOR.replace( 'yourInstanceHere', {
    on: {
        getData: function( evt ) {
            evt.data.dataValue = '<div dir="rtl">' + evt.data.dataValue + '</div>';
        }
    }
} );
Run Code Online (Sandbox Code Playgroud)