May 062018
 

Here is a little code snippet to be added in a .module file.

Additional Information

  • Instructions made on Drupal 8.5.x.
  • Will break text align buttons in the CKEditor toolbar: Issue on Drupal.org
  • The default behaviour of CKEditor is the following:
    • Enter: inserts a paragraph directly in the WYSIWYG,
    • Shift + Enter: inserts a line break.
  • The new behaviour of CKEditor with the hook will be:
    • Enter: inserts a single line break (br),
    • 2 × Enter: inserts two line breaks which will be converted into a paragraph when rendered.

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">