Repository navigation
Conversation
Markra shows every single line break inside a paragraph as a real line break (markrahq#451, for markrahq#449). Files that wrap long lines by hand, such as list items wrapped at 120 columns, then render as ragged short lines, while GitHub and other CommonMark renderers join those lines into one paragraph. Add "Join single line breaks" under Settings > Extended syntax. It is off by default, so the current behavior does not change. When it is on: - soft breaks from the source render as a space, as Milkdown does by default; - Shift+Enter breaks, callout lines and hard breaks (backslash or two trailing spaces) still render as line breaks; - HTML and PDF export skip remark-breaks. Only the display changes. The saved Markdown is the same in both modes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@leemour is attempting to deploy a commit to the murongg's projects Team on Vercel. A member of the Team first needs to authorize it. |
leemour
marked this pull request as draft
November 24, 2026 00:41
Contributor
Author
|
Opened against the wrong branch (main, 1.x). Superseded by #800, which fixes the list alignment on v2. |
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
Adds an opt-in setting that joins single line breaks inside a paragraph, the way GitHub and other CommonMark renderers do.
Since #451 (for #449), the visual editor shows every single line break from the source as a real line break. That's right for files written line by line, but files that wrap long lines by hand turn into ragged short lines. For example, a list item wrapped at 120 columns:
The new switch is Settings → Extended syntax → Join single line breaks. It's off by default, so nothing changes for current users.
Changes
packages/app/src/components/markdown-paper-plugins.ts:markraCommonmarktakes{ joinSoftLineBreaks }and passes it to the hardbreak schema. When it's on, a soft break (isInlinewithoutrenderLineBreak) renders as a span with a space, like Milkdown's default. The span has nomarkra-hardbreakclass, soparseDOMwon't read it back as a rendered<br>. Shift+Enter breaks, callout lines and hard breaks (backslash or two trailing spaces) still render as<br>.packages/app/src/components/MarkdownPaperSurface.tsx: reads the flag fromextendedSyntaxand recreates the editor when it changes, the same waygithubAlertsworks.packages/app/src/components/MarkdownExportDocument.tsx: HTML/PDF export skipsremark-breakswhen the setting is on, so export matches the editor.packages/app/src/lib/settings/app-settings.ts,EditorSettings.tsx: the newextendedSyntax.joinSoftLineBreakspreference (defaultfalse) and its switch.packages/shared/src/i18n/locales/*: labels in all 11 locales.Only the display changes. The serializer is untouched, and a test checks that both modes save the same Markdown.
Behavior
\or two-space hard breakremark-breaks(unchanged)remark-breaksDesktop and web behave the same.
Verification
pnpm --filter @markra/shared testpassed, 52 testspnpm --filter @markra/app typecheck:testpassedpnpm --filter @markra/app buildpassedpnpm --filter @markra/app test: 1855 passed, 1 failed. The failing test isApp.test.tsx > opens a document tab to a side editor, toggles both panes to source mode, and closes the side tab from the titlebar, which times out at 5000 ms. It fails the same way onmainwithout this change.apps/web, Vite) in Chrome. I couldn't run Playwright's WebKit on Ubuntu 26.04.Risks
If you'd rather name or place the switch differently, I'm happy to change it.
I worked on this together with Claude Code.
🤖 Generated with Claude Code