Documentation

Inline

Type: Object

Default: object

By default, the following object is set in the inline tags formatting menu:

{
    "bold": {
        title: '<span style="font-weight: bold;">## inline.bold ##</span>',
        command: 'inline.format',
        params: { tag: 'b' }
    },
    "italic": {
        title: '<span style="font-style: italic;">## inline.italic ##</span>',
        command: 'inline.format',
        params: { tag: 'i' }
    },
    "deleted": {
        title: '<span style="text-decoration: line-through;">## inline.deleted ##</span>',
        command: 'inline.format',
        params: { tag: 'del' }
    }
}

You can disable some object values:

ArticleEditor('#entry', {
    inline: {
        "bold": {
            title: '<span style="font-weight: bold;">## inline.bold ##</span>',
            command: 'inline.format',
            params: { tag: 'b' }
        },
        "italic": false,
        "deleted": false
    }
});

Or add your own values, for example Underline:

ArticleEditor('#entry', {
    inline: {
        "bold": {
            title: '<span style="font-weight: bold;">## inline.bold ##</span>',
            command: 'inline.format',
            params: { tag: 'b' }
        },
        "italic": {
            title: '<span style="font-style: italic;">## inline.italic ##</span>',
            command: 'inline.format',
            params: { tag: 'i' }
        },
        "underline": {
            title: '<span style="text-decoration: underline;">Underline</span>',
            command: 'inline.format',
            params: { tag: 'u' }
        },
        "deleted": {
            title: '<span style="text-decoration: line-through;">## inline.deleted ##</span>',
            command: 'inline.format',
            params: { tag: 'del' }
        }
    }
});

Here is an example of how to add inline formatting items with classes and attributes:

"redmark": {
    title: '<span style="color: #fff; background: #ff3265; padding: 2px 8px; border-radius: 3px;">Redmark</span>',
    command: 'inline.format',
    params: {
        tag: 'span',
        attr: {
            'class': 'redmark'
        }
    }
},
"boldmark": {
    title: '<b style="color: #ff3265;">Boldmark</b>',
    command: 'inline.format',
    params: {
        tag: 'b',
        attr: {
            'class': 'boldmark',
            'data-type': 'boldmark'
        }
    }
}

You can also completely disable the formatting of inline tags in the menu:

ArticleEditor('#entry', {
    inline: false
});