insert line break instead of

in TinyMCE

前端 未结 8 1803
难免孤独
难免孤独 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 : ''
    });
    

提交回复
热议问题