Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insert a hard break without loosing formatting. #1934

Closed
philippkuehn opened this issue Sep 23, 2021 Discussed in #1933 · 2 comments
Closed

Insert a hard break without loosing formatting. #1934

philippkuehn opened this issue Sep 23, 2021 Discussed in #1933 · 2 comments

Comments

@philippkuehn
Copy link
Contributor

Discussed in #1933

Originally posted by hans-pragt September 23, 2021
If I enable the hardbreak extension and extend it to listen for the enter key, starting a paragraph in bold, pressing enter, and further typing will result in:

<p><strong>This is a test</strong><br>this is also a test</p>

Even though the bolding was never explicitly turned off. How do I prevent this behavior and keep bold enabled across lines?

@philippkuehn
Copy link
Contributor Author

The setHardBreakcommand now keeps splittable marks by default. Splittable marks are based on the keepOnSplit option for marks.

SomeMark.extend({
  keepOnSplit: false,
})

You can disable that feature at all with a new keepMarks option on the HardBreak extension.

HardBreak.configure({
  keepMarks: false,
})

@hans-pragt
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants