editor-js / header

Header Tool for Editor.js 2.0
MIT License
101 stars 122 forks source link

Fix Header Tool not supporting line breaks #74

Open mrspence opened 2 years ago

mrspence commented 2 years ago

What's the issue?

Currently the Header Tool does not support line breaks like other Tools do. Normally a user can press Shift + Enter which adds a line break. However at the moment this tool strips line breaks out.

This pull request fixes:

Solution

This pull request adds a config parameter allowLineBreaks: {Boolean} that allows the developer to enable line breaks should they need.

config: {
    allowLineBreaks: true, // default: false
}

By default, line breaks are not enabled, as per the current status quo.