Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Ckeditor5-列表';类型';ul/ol标签上的属性?_Javascript_List_Ckeditor_Ckeditor5 - Fatal编程技术网

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>