Files
sim/apps
Waleed 5460133e07 fix(files): collapse blank-line runs to markdown standard (no empty-paragraph explosion / reflow) (#6198)
parseMarkdownToDoc now strips ALL top-level empty paragraphs (leading, interior, trailing),
not just trailing. A run of blank lines between blocks is insignificant in markdown
(CommonMark collapses it), but @tiptap/markdown reconstructs one empty paragraph per blank
line — which made the mounted editor render vertical gaps that exist nowhere else the file
is viewed (GitHub, download, our own static preview), let a pathological blank run explode
into thousands of empty nodes, and caused the visible reflow on open (static preview
collapses empty <p>; the live editor gives each a trailing-break line). Collapsing on parse
keeps normal one-blank-line spacing, matches every standard renderer, and stays idempotent
so the round-trip-safety probe still reaches a fixed point (files stay editable; existing
files normalize on next cold-open + save). Serializer is intentionally NOT changed — a
global blank-run collapse there would corrupt blank lines inside fenced code blocks.
2026-08-02 17:45:41 -07:00
..