itemprop属性を編集できるカスタムプラグインを作成しています。 リロード時にプロパティが取り除かれる以外は素晴らしいです。 私が間違っていることは何ですか?CKeditorカスタムプラグインallowedContent not working
私はこの例を含むドキュメントで見つけることができるすべてを読む:私はACFを無効にした場合、それが動作https://github.com/ckeditor/ckeditor-docs-samples/blob/master/tutorial-abbr-acf/abbr/plugin.js#L24
を。
export default CKEDITOR => {
CKEDITOR.plugins.add('itemprop', {
init(editor) {
editor.addCommand('itemprop', new CKEDITOR.dialogCommand('itempropDialog', {
allowedContent: '*[itemprop]'
}));
CKEDITOR.dialog.add('itempropDialog', editor => {
return {
title: 'Itemprop',
contents: [
{
id: 'tab-main',
label: 'Itemprop',
elements: [
{
type: 'text',
id: 'itemprop',
label: 'Itemprop',
setup(element) {
this.setValue(element.getAttribute('itemprop'));
},
commit(element) {
element.setAttribute('itemprop', this.getValue());
}
}
]
}
],
onShow() {
const selection = editor.getSelection();
const element = selection.getStartElement();
this.element = element;
this.setupContent(this.element);
},
onOk() {
this.commitContent(this.element);
}
};
});
}
});
};
今の私がすることができました'extraAllowedContent( '* [itemprop]')'を使って動作させてください。ただし、私は自動化された解決策を働かせたいと思っています。 – Dmitri