jquerytinymcekeypressline-breaksparagraph

force tinymce to enter newline with enter keypress rather than making a new paragraph


When a user hits the Enter key while using TinyMCE, it doesn't add a new line, it adds a new paragraph. Can I change this behavior and force it only to add a line break <br /> instead of a new paragraph?


Solution

  • Oops the answer's right here: https://www.tinymce.com/docs/configure/content-filtering/#forced_root_block

    tinyMCE.init({
        ...
        forced_root_block : 'p'
    });