Skip to content

Fix phantom blank lines in Markdown rendering and editing - #79

Closed
BinaryOutlook wants to merge 2 commits into
mainfrom
feat/blank-line-semantics
Closed

BinaryOutlook wants to merge 2 commits into
mainfrom
feat/blank-line-semantics

Conversation

@BinaryOutlook

@BinaryOutlook BinaryOutlook commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Blank Markdown separators were rendered as editable empty paragraphs, and ordinary source wraps became separate paragraphs. The example in #16 therefore displayed 13 blocks instead of its seven content blocks. This change renders semantic Markdown blocks and keeps source spacing separately, so additional separators and a final newline no longer create visible rows.

In ordinary prose, Enter now creates a paragraph and Shift+Enter creates an explicit hard line break. Saved paragraph boundaries survive reopening.

Changes

  • Replace the line-by-line block renderer with a bundled, pinned Markdown block parser, retaining the existing inline renderer and editor extensions.
  • Preserve authored source and separators for unchanged blocks; distinguish real hard breaks from editor caret placeholders. Update serialization, selection-to-source mapping, copy/paste and export together.
  • Preserve ordered-list starts, loose-list continuation paragraphs and code whitespace. Honor explicit table alignment in headers as well as body cells, including header-only tables.
  • Add parser, production-browser and installed-VSIX regressions, plus build integration, bundled dependency notices and user/testing guidance.

Related to #16. This addresses its phantom-line and explicit-alignment concerns. The broader Primer typography, shared theme spacing and page-padding changes remain separate work; full CommonMark/GFM inline conformance is also outside this PR.

Validation

CI run 36221235399 passed on commit f6a7e3989869e353754f5c11078fc12ad9643073: candidate build, Ubuntu, Windows, macOS, minimum-supported VS Code, and the final VSIX validation gate.

The CI follow-up normalizes Windows clipboard line endings in one assertion and waits for the pending typing notification before checking that theme changes emit no edits. Both affected browser suites also passed five local repetitions: 150 tests passed, with no retries.

Local validation used Node 24.21.0 on macOS ARM64:

  • Full Chromium suite: 1,124 passed, with no retries. After the final front-matter-only whitespace adjustment, 29 focused browser tests and 7 parser tests passed, and the final VSIX package/source gate passed separately.
  • Unit tests with real Pandoc/Chromium converters: 303 passed. The package gate was skipped in that run and subsequently passed against the final VSIX as noted above.
  • Installed VS Code 1.138.0: measured soft wraps and hard breaks, no separator paragraphs, Enter/Shift+Enter typing, exact saved bytes, Source mode, save/reopen and HTML export all passed. The installed editor was visually inspected.
  • Full root compilation and Electron TypeScript compilation passed. Lint reported no errors and 11 existing warnings.
  • Documentation links, whitespace checks, raw Markdown review and rendered previews passed.

Native validation used a local development VSIX built before the commit, with matching runtime source; it was not a release candidate. Windows/Linux native validation, Electron runtime checks and comparisons in other Markdown readers were not performed locally. Cross-platform validation of the published commit passed in the CI run linked above.

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.

1 participant