Javascript Ckeditor5-列表';类型';ul/ol标签上的属性?
我希望允许Javascript Ckeditor5-列表';类型';ul/ol标签上的属性?,javascript,list,ckeditor,ckeditor5,Javascript,List,Ckeditor,Ckeditor5,我希望允许上的“type”属性和ckEditor 5生成的标记。 通过setData()设置数据并通过type=“A”传递时,CkEditor列表插件会从列表中删除所有属性标记 代码: 输出: <ol> <li type="A">hello</li> <li type="A">hello</li> <li type="A">hello</li> </ol> 你好 你好 你好
上的“
type
”属性和ckEditor 5生成的标记。
通过setData()
设置数据并通过type=“A”
传递
时,CkEditor
列表插件会从列表中删除所有属性标记
代码:
输出:
<ol>
<li type="A">hello</li>
<li type="A">hello</li>
<li type="A">hello</li>
</ol>
你好
你好
你好
如何允许生成的和
html标记上的type属性
我需要将它们注册为具有允许属性的模式还是设置转换
这已作为一个问题在github上多次提出
是否有人知道解决方案是否已经存在,或者可以建议如何继续
<ol>
<li>hello</li>
<li>hello</li>
<li>hello</li>
</ol>
editor.model.schema.register( 'listItem', {
inheritAllFrom: '$block',
allowAttributes: [ 'listType', 'listIndent', 'type' ]
} );
editor.conversion.attributeToAttribute( { model: 'type', view: 'type' }, );
<ol>
<li type="A">hello</li>
<li type="A">hello</li>
<li type="A">hello</li>
</ol>