typescriptjodit

How can I maintain styles upon pressing Enter in Jodit text editor?


After applying styles (Bold, Italic, etc..), pressing enter creates a new line and the styles have been removed. How can I prevent this and carry over the styles to the new line?


Solution

  • You have to set the enter key to br in the Jodit config.

    const editor = new Jodit('#element', { enter: 'br' })
    

    Hope that helps!

    Reference:
    https://xdsoft.net/jodit/doc/options/enter/