liluxdev / summernote-addclass

A plugin for summernote editor to allow user to add custom css classes (custom styling) to the selected elements
MIT License
33 stars 16 forks source link

<span></span> it shows as <undefined></undefined> #5

Closed WaKeMaTTa closed 7 years ago

WaKeMaTTa commented 7 years ago

Why i get undefined instead of span :question:

image


Specs

WaKeMaTTa commented 7 years ago

I found the soultion. You need to pass tag: "div".

Example:

$('#summernote').summernote({
    addclass: {
        debug: false,
        classTags: [{ title: "Highlight for H1 and H2", tag: "div" value: "custom"}]
    },
    height: 300,
    toolbar: [
        // [groupName, [list of button]]
        ['style', ['style', 'addclass', 'clear']],
    ]
});