如何告诉ckeditor5默认使用我的自定义标题类型

时间:2020-06-06 08:09:50

标签: ckeditor ckeditor5

我正在使用@ckeditor/ckeditor5-editor-classic@18.0.0的自定义版本

    heading : {
        options: [
            {
                model            : 'inlineParagraph',
                view             : 'span',
                title            : 'Inline Paragraph',
                class            : 'ck-heading_paragraph_inline',
                converterPriority: 'highest'
            },
            { model: 'paragraph',  title: 'Paragraph', class: 'ck-heading_paragraph' },
            { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' },
            { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' },
            { model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' },
            { model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4' },
        ]
    }

当编辑器中没有文本时,我希望inlineParagraph为默认类型,默认情况下,编辑器会选择paragraph

我也尝试过这个:

    heading : {
        options: [
            {
                model            : 'inlineParagraph',
                view             : 'span',
                title            : 'Inline Paragraph',
                class            : 'ck-heading_paragraph_inline',
                converterPriority: 'highest'
            },
            { model: 'paragraph', view: 'span', title: 'Paragraph', class: 'ck-heading_paragraph' },
            { model: 'div', title: 'Div', class: 'ck-heading_div' },
            { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' },
            { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' },
            { model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' },
            { model: 'heading4', view: 'h4', title: 'Heading 4', class: 'ck-heading_heading4' },
        ]
    }

但是随后它选择div作为默认值...我认为它默认为块级元素...但我想将其更改为span等内联元素...

0 个答案:

没有答案