CKEditor 内にエディター自体が触れず、ユーザーが明示的に変更するまで意図した状態に維持されるコード ブロックを作成することは可能ですか? javascript 変数 (script タグにバインド) とフラッシュ ムービーを入力しようとしましたが、CKEditor は貼り付けたコード/マークアップを書き換え続け、コードを壊します。
私は次の設定で作業しています:
<script type="text/javascript">
var editor = CKEDITOR.replace("content", {
height : "500px",
width : "680px",
resize_maxWidth : "680px",
resize_minWidth : "680px",
toolbar :
[
['Source','-','Save','Preview'],
['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['Link','Unlink','Anchor'],
['Image','Table','HorizontalRule','SpecialChar']
]
});
CKFinder.SetupCKEditor( editor, "<?php print url::base(); ?>assets/ckfinder" );
</script>
最も理想的な解決策はclass="preserve"
、限られた排他的機能よりもはるかに多くの機能を有効にするタグの内容を保持することだと思います。
更新: この問題の解決策はCKEDITOR.config.protectedSource()
. 「preserved」クラスを含むすべてのタグが CKEditor によって触れられないようにするにはどうすればよいですか?