Summernote error while removing Bold

Asked

Viewed 51 times

0

I’m using Summernote with these settings :

$('#editor1').summernote({
    toolbar: [
        ['custom', ['comment']],
        ['style', ['style']],
        ['font', ['bold', 'underline', 'clear']],
        ['fontname', ['fontname']],
        ['color', ['color']],
        ['para', ['ul', 'ol', 'paragraph']],
        ['table', ['table']],
        ['insert', ['link', 'picture', 'video', 'modalcomment']],
        ['view', ['fullscreen', 'codeview','help']]
    ],
    // popover
    popatmouse: true,
    popover: {
        image: [
            ['imagesize', ['imageSize100', 'imageSize50', 'imageSize25']],
            ['float', ['floatLeft', 'floatRight', 'floatNone']],
            ['remove', ['removeMedia']],
            ['custom', ['comment']]
        ],
        link: [
            ['link', ['linkDialogShow', 'unlink']]
        ],
        table: [
            ['add', ['addRowDown', 'addRowUp', 'addColLeft', 'addColRight']],
            ['delete', ['deleteRow', 'deleteCol', 'deleteTable']]
        ],
        air: [
            ['color', ['color']],
            ['font', ['bold', 'underline', 'clear']],
            ['para', ['ul', 'paragraph']],
            ['table', ['table']],
            ['insert', ['link', 'picture']]
        ]
    },
    disableDragAndDrop: true,
    lang: 'pt-br',
    tabsize: 2,
    height: 650,
    dialogsInBody: true,
    codemirror: { // codemirror options
        theme: 'monokai'
    },
    callbacks: {
        onImageUpload: function (image) {
            uploadImage(image[0]);
        },
        onKeyup: function () {
            window.sessionStorage.setItem('conteudo', $('#editor1').summernote('code'));
            window.sessionStorage.setItem('id', $('#conteudo--id').attr('data-id'));
        }
    }
});

but for some reason the Bold is not working to remove the style he adds, any idea of what might be ?

1 answer

0


The problem was found, what happened was the CSS of the page where it defined the font-Weight different from the default, so when adding a css :

b {
    font-weight: 700;
}

summernote was able to identify the parts of the text that were in bold.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.