Hello all,
Following CRISTALNC-37 - Empty lines are not saved opened by @paulinebessoles I’d like to start a discussion on the handling of multiple empty lines in Markdown.
To explain the problem quickly, a user edit a page and adds a dozen lines between two paragraphs, then save.
The user expects the large gap between two paragraphs to be persisted. But, it is currently not the case and the gap between the two paragraphs is simply the standard spacing between two paragraphs.
In technical term, this is explained easily. Markdown specific that “Multiple blank lines between paragraphs have no effect” (CommonMark Spec).
But, on the other hand, this is a not aligned with the notion of WYSIWYG. The user did the intentional choice of adding a large gap and this was reflecting in its editing experience.
As it can impact some decisions, the technical scope includes:
- Two Markdown parsers and serializers:
- CommonMark Markdown Syntax 1.2 contrib extension
- Uniast Markdown client-side
- Two editors: CKEditor 4 and Blocknote.
- The external sources where the markdown can be viewed through other viewers and editors. I’m mainly thinking of Cristal’s backends such as Nextcloud, Github, etc.
Also, not that the XWiki syntax support larger gap and intermediate empty paragraphs (<div class="wikimodel-emptyline"></div> when rendered in HTML).
Option 1 - do nothing
We consider that the possibility to add spaces between paragraphs is giving too much formatting control to users and that this shouldn’t be persisted.
Cons:
- Not WYSIWYG
- Contradict what’s done with xwiki/2.1
Pros:
- Easy as there is nothing to do (close CRISTALNC-37 as won’t fix)
Option 2 - restrict the editor
Restrict the editor and disallow adding several empty lines in a row
Pros:
- WYSIWYG
Cons:
- Not sure about the feasibility
Option 3 - become blank lines aware
Pros:
- I expect this to be an easy parser/serializer change
- WYSIWYG
Cons:
- Not necessarily supported by all backends, but I think this is acceptable, but there is a risk that editing the markdown with another editor removes the blank lines
Option 4 - explicitly mark blank lines
Use an explicit separator to mark blank lines (e.g., or <br />)/.
For instance:
A
B
Pros: Same as 3 - easy implementation + WYSIWYG
Cons:
- Probably better support for other backends. Except if the separator is not handled, which is a reasonable risk. We can also make the separator configurable based on the backend if needed.
Conclusion
+1 for option 4 as it feels the most aligned with what we already have.

