Describe the bug
In the new richtext widget, soft line breaks (shift + enter) do not emit a line break in the final Markdown. In the old markdown widget these would emit \ at the end of the line to force a hard line break, but the new widget doesn’t include this, causing many Markdown renderers (including Decap’s built-in preview) to ignore the newline.
To Reproduce
- Open an item in the CMS that uses the
richtext widget.
- Add some text that includes soft line breaks (e.g. type while using shift + enter to break up your text)
- Observe that no line breaks are shown in the preview pane
- Observe that when saving the item, the Markdown output includes newlines but no trailing
\.
Expected behavior
The editor should output \ at the end of soft line breaks like the markdown widget does. (Or an alternative like a <br> element.)
Screenshots
Here’s an example of soft line breaks in the editor and rendering without breaks in the preview pane:
Applicable Versions:
- Decap CMS version: 3.12.2
- Git provider: not relevant
- OS: macOS
- Browser version: Firefox 150
- Node.JS version: 24.15.0
CMS configuration
It’s a lot in my case, but here’s a relevant fields config:
{
name: 'body',
label: 'Page contents',
widget: 'richtext',
buttons: ['bold', 'italic', 'link', 'heading-two', 'quote'],
editor_components: ['image'],
modes: ['rich_text'],
},
Describe the bug
In the new
richtextwidget, soft line breaks (shift + enter) do not emit a line break in the final Markdown. In the oldmarkdownwidget these would emit\at the end of the line to force a hard line break, but the new widget doesn’t include this, causing many Markdown renderers (including Decap’s built-in preview) to ignore the newline.To Reproduce
richtextwidget.\.Expected behavior
The editor should output
\at the end of soft line breaks like themarkdownwidget does. (Or an alternative like a<br>element.)Screenshots
Here’s an example of soft line breaks in the editor and rendering without breaks in the preview pane:
Applicable Versions:
CMS configuration
It’s a lot in my case, but here’s a relevant
fieldsconfig: