Skip to content

fix(preview): a line end stays a line break (#57) - #58

Merged
gitubpatrice merged 2 commits into
mainfrom
fix/57-preview-line-breaks
Nov 10, 2026
Merged

gitubpatrice merged 2 commits into
mainfrom
fix/57-preview-line-breaks

Conversation

@gitubpatrice

Copy link
Copy Markdown
Owner

Fixes #57 in 3.4.0, which is merged but not yet published.

What was wrong

In the preview, a single line end inside a paragraph became a space. That is CommonMark, and what 2.0.9 did (softLineBreak: false). Measured on the JVM:

Typed Preview before
1. Eat ⏎ 2. Drink (space after the dot) a list ✅
1.Drink water ⏎ 2.Eat (the issue's example) 1.Drink water 2.Eat, one line
1.Eat (full-width dot), 1. Eat (ideographic space), no-break space one line
Today: ⏎ 2. Eat ⏎ 3. Drink one line

Change (D-045, docs/15-VERSION-3.4.md)

  • Every line end is a line break, as in the editor. A note is written line by line on a phone. Obsidian, Joplin and GitHub's comments do the same. List recognition does not change: 1.Eat is still text, now on its own line.
  • A hard break (two spaces or \) still gives one break. A line holding only \ keeps its empty line.
  • Legal pages: they go through the same reader. In the 5 terms.md, the MIT notice of whisper.cpp was wrapped at about 100 columns, and so was the paragraph introducing it in English and French. Each paragraph is now on one line. Only spacing changes, checked by script. The three copyright lines stay separate lines, as in the licence. privacy.md had no wrapped paragraph. "About" shows only string resources, so it needed no change.
  • Guard: PagesLegalesTest now checks that no paragraph of a legal page holds a line end, except the copyright lines. Negative control: the old English terms.md makes it fail.
  • Not affected: in-note search (it searches word by word), inline code (its line ends stay spaces, per CommonMark), export, import.
  • Changelogs 5071-5073: one more line in all 5 languages, ≤ 491 characters (German).

Checks

  • Local gate: assembleDebug testDebugUnitTest lintDebug detekt ktlintCheck, green.
  • New JVM cases: the issue's inputs, a real ordered list, the single hard break, a line holding only \, a break inside a style or a link, plus the legal-page guard.

Reply to #57: post AFTER the 3.4.0 release

Thanks for the precise report, it made the cause easy to find.

The preview followed the CommonMark rule: inside a paragraph, a single line break is shown as a space. Your lines 1.Drink water / 2.Eat / 3.Sleep. have no space after the dot, so they are not a Markdown list, and the preview joined them into one line. The same happens when a keyboard types a full-width dot . or a full-width space after the number.

Starting with 3.4.0, the preview keeps every line break you type: what is on its own line in the editor stays on its own line in the preview. A real Markdown list still needs a space after the number (1. Drink water), and it is then drawn as a list with aligned numbers.

🤖 Generated with Claude Code

gitubpatrice and others added 2 commits November 10, 2026 13:35
Issue #57: three lines typed "1.Drink water", "2.Eat", "3.Sleep." came out
in the preview as ONE line, "1.Drink water 2.Eat 3.Sleep.".

Measured on the JVM: "1. Eat" with a space after the dot IS a list in the
preview. Everything else followed CommonMark, as 2.0.9 did
(softLineBreak: false): a single line end inside a paragraph became a
space. So these all came out on one line: "1.Eat" with no space (not a
list), a full-width dot or ideographic space typed by an Asian keyboard,
a no-break space, a list starting at "2." under a line of text, and any
run of plain text lines.

Now every line end is a line break, as in the editor (D-045): a note is
written on a phone, line by line, and Obsidian, Joplin and GitHub's
comments keep line ends the same way. List recognition does not change.
A hard break (two spaces or a backslash) still gives ONE break: the line
end it sits on adds nothing after it.

The legal pages go through the same reader. The five terms.md quoted the
whisper.cpp MIT notice wrapped at about 100 columns (and, in English and
French, the paragraph introducing it): each paragraph is now on one line.
Only spacing changes, checked by script; the three copyright lines stay
lines, as in the licence, and now show one under the other.
PagesLegalesTest keeps every paragraph of a legal page on one line;
negative control: the old English terms.md makes it fail.

Changelogs 5071-5073 get one line in the five languages (longest: German,
491 characters).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed 3.4.0 APKs checked (TOUT OK), update 3.3.0 -> 3.4.0 tried on the
S9 with the issue #57 note, F-Droid state of 10 November, site draft PR,
and the steps of release day.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gitubpatrice
gitubpatrice merged commit fe8b003 into main Nov 10, 2026
17 of 19 checks passed
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

Successfully merging this pull request may close these issues.

Bug?Note Preview Error

1 participant