私はChromeブラウザのテキスト入力用のリッチエディタとしてCkeditorを使用しています。また、システムがデータを取得した後、bs4で簡単に解析できるように、いくつかのhtml idタグを追加しました。Ckeditor allowedContent for htmlタグ
次は、HTMLの私の設定です:
CKEDITOR.replace('editor', {
toolbar : 'Basic',
uiColor : '#9AB8F3',
height : '70%',
startupShowBorders: false,
})
そしてconfig.jsの中:
config.toolbarGroups = [
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
{ name: 'links' },
{ name: 'insert' },
{ name: 'forms' },
{ name: 'tools' },
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
{ name: 'others' },
'/',
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
{ name: 'styles' },
{ name: 'colors' },
{ name: 'about' }
];
// Remove some buttons provided by the standard plugins, which are
// not needed in the Standard(s) toolbar.
config.removeButtons = 'Underline,Subscript,Superscript';
// Set the most common block elements.
config.format_tags = 'p;h1;h2;h3;pre';
// Simplify the dialog windows.
config.removeDialogTabs = 'image:advanced;link:advanced';
config.allowedContent = True;
};
私はconfig.jdにconfig.allowedContent = *;
で保存されるすべてのhtmlタグのコンテンツを許可する指示に従っていますが、これに代えて
<span style='font-size:11.0pt;'> content </span>
を私がしたいこと:(CKEDITOR.instances.editor.getData()
で)データを取得するときに、私は以下の結果を得たとして、しかし、それは動作しないようですつまり
<span id="news_content" style='font-size:11.0pt;'> content </span>
、それはまだすべてのアウトストリップ私が追加したhtmlタグ
私はソースコードをチェックすると、私は同じテキストエリアの内容が隠された形式に置かれているタグと1で二回生成していることを確認、すなわち、
<textarea name="editor" id="editor" rows="100" cols="40" style="visibility: hidden; display: none;">
、エディタは、別のバージョンを作成するには私が編集できる実際のテキストエリア。しかし、これはすべてのhtmlタグが削除されているので役に立たない。
私の質問は、実際のテキストエリアにhtmlタグを保存して、編集と提出後にidタグを使ってhtmlを解析できるようにすることです。誰もこれについて助言することができますか?どうもありがとう。