Copy & Paste custom tags in CKEDITOR 4.0

后端 未结 2 1950
时光取名叫无心
时光取名叫无心 2021-01-07 13:21

I have some custom tags inside my HTML.

Like text. I want to copy this whole tag and paste the same. When i try

2条回答
  •  不要未来只要你来
    2021-01-07 14:07

    You can create a Widget for each custom tag. Don't forget to specify the allowedContent- and requiredContent-Attributes. And modify the dtd to make the tag editable.

    For example:

    CKEDITOR.dtd.$editable['mytag'] = 1;    
    editor.widgets.add('mytagWidget', {
            allowedContent: 'mytag(atr)',
            requiredContent: 'mytag',
            template: 'text',
            editables: {
                text: {
                    selector: '.atr'
                }
            },
            ...
    

提交回复
热议问题