insert line break instead of

in TinyMCE

前端 未结 8 1787
难免孤独
难免孤独 2021-02-04 07:55

I have initialised TinyMCE as follows. I want to force line breaks when user presses enter and not the paragraphs. I\'m trying following, but not working. I\'m using TinyMCE ve

相关标签:
8条回答
  • 2021-02-04 08:39

    in tinyMCE 5 I needed to add 1 extra parameter

    tinymce.init({
        ...
        valid_elements: 'br',
        force_br_newlines : true,
        force_p_newlines : false,
        forced_root_block : ''
    });
    
    0 讨论(0)
  • 2021-02-04 08:44

    Simply add forced_root_block : false

    Or if you want a wrapper: forced_root_block : 'div',

    Works like a charm!

    0 讨论(0)
提交回复
热议问题