Port upstream soft break export fix#66
Closed
Renakoni wants to merge 1 commit into
Closed
Conversation
Owner
Author
|
Reviewed for the Android client: this fix lands entirely in Muya's HTML-export path ( Recommendation: close as desktop-only surface for now. If an "export/share as HTML" feature ever lands on Android, this port can be revived from upstream #4844 — the change itself is a safe, CSS-only addition with a regression spec, so nothing blocks re-porting later. |
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
white-space: pre-wrap.<br>.Upstream Source
Android Relevance
The Android repo carries Muya's HTML export implementation and stylesheet. A soft line break is represented as a bare newline inside a paragraph or tight list item. The live editor shows it because editor content uses pre-wrap behavior, but exported HTML could collapse it into a space. This keeps the embedded Muya export path consistent with editor rendering without changing the CommonMark HTML produced by
getHighlightHtml().Change Details
.markdown-body pand tight list items (li:not(:has(> p))) to usewhite-space: pre-wrap.softBreakExportHtml.spec.tsasserting soft breaks remain newlines and hard breaks still render as<br>.Verification
pnpm --dir third_party/muya exec vitest run src/state/__tests__/softBreakExportHtml.spec.tspassed.pnpm buildpassed.