Separate soft break mode from significantNewlines parsing#126
Merged
dereuromark merged 3 commits intomasterfrom Mar 25, 2026
Merged
Separate soft break mode from significantNewlines parsing#126dereuromark merged 3 commits intomasterfrom
dereuromark merged 3 commits intomasterfrom
Conversation
875ed52 to
4986515
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #126 +/- ##
============================================
+ Coverage 93.92% 93.94% +0.01%
- Complexity 2383 2384 +1
============================================
Files 81 81
Lines 6306 6310 +4
============================================
+ Hits 5923 5928 +5
+ Misses 383 382 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4986515 to
a4e7676
Compare
Previously, enabling `significantNewlines` mode automatically made soft breaks render as `<br>` tags. This couples two unrelated concerns: 1. Parsing relaxation (blocks can interrupt paragraphs) 2. Rendering behavior (soft breaks become visible) This change separates these concerns by: - Adding an optional `softBreakMode` parameter to the constructor - When explicitly provided, it overrides the automatic behavior - When null (default), `significantNewlines` still implies `<br>` for backwards compatibility
a4e7676 to
800765a
Compare
Previously, the immediate nesting path (significantNewlines mode) would break on any blank line within nested content, causing blank lines between nested list items to split them into separate lists. Now both nesting paths (immediate and standard) handle blank lines consistently - they continue collecting nested content across blank lines, only breaking when returning to parent indent level.
Documents how blank lines between list items affect rendering, with examples showing the difference between tight lists (no <p> tags) and loose lists (wrapped in <p> tags).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
softBreakModeparameter toDjotConverterconstructor andwithSignificantNewlines()factorysignificantNewlinesalone still implies<br>soft breaksMotivation
The
significantNewlinesmode couples two unrelated concerns:<br>tagsThis change allows using relaxed parsing without
<br>tags: