Replies: 1 comment 1 reply
-
@Lukasvo did you manage to make it work? I'm struggling with a similar case, #7060 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'd like to mimic Facebook's behaviour where typing 'enter' doesn't start a new paragraph but introduces a linebreak instead.
However, If they press enter twice, it should start a new paragraph.
How could I implement this?
I've tried writing a plugin that merges a new paragraph with the previous paragraph as soon as it contains any text:
This needs to be extended to prevent merging if the previous paragraph is empty (= start a new paragraph when entering two linebreaks), but then I'd need to make sure this paragraph doesn't get merged with the one before subsequently. I tried making a CustomParagraphNode with a flag that indicates if the paragraph can be merged (= it's a linebreak) or not (= it's a paragraph), but without success thus far.
Just keeping the above implementation, which simply replaces paragraphs by
<br /><br />
, would be acceptable too if it weren't for the fact that you can't set headings, list items etc. anymore, because the whole text is a single paragraph.Does anyone have recommendations?
Beta Was this translation helpful? Give feedback.
All reactions