getkirby/editor

Line break not working for custom paragraph

medienbaecker opened this issue · 2 comments

Describe the bug
Using Shift + Enter to insert a line break seems to be hard-coded for the core paragraph block type.
When extending that block type like the Intro example, line breaks don't work. It seems similar to #190 but this issue was closed for some reason.

To Reproduce
Use the Intro example block type and try pressing Shift + Enter. Compare the result with the regular paragraph.

Expected behavior
Line breaks should be possible for all block types. Otherwise it renders custom paragraph blocks useless.

Screenshots
Here I use the Intro example and try pressing Shift + Enter:

linebreaks

Kirby Version
3.3.3

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Chrome 80.0.3987.106

Adding breaks: true to index.js enables the line breaks:

editor.block("intro", {
  extends: "paragraph",
  label: "Intro",
  icon: "text",
  breaks: true
});

I found this by looking at the headline blocks. It should be added to the documentation/examples though.