Skip to content

Fix live preview table gaps#100

Merged
jsgrrchg merged 1 commit into
mainfrom
fix/live-preview-table-gaps
May 17, 2026
Merged

Fix live preview table gaps#100
jsgrrchg merged 1 commit into
mainfrom
fix/live-preview-table-gaps

Conversation

@jsgrrchg
Copy link
Copy Markdown
Owner

Summary

Fixes the extra vertical space around rendered Markdown tables in live preview.

Root Cause

CodeMirror was keeping visual line boxes for inactive blank lines adjacent to table block widgets. The table itself was replaced by a live preview widget, but the surrounding blank Markdown lines still occupied editor height.

Changes

  • Expand the table replacement range to account for inactive adjacent blank lines.
  • Add a cm-lp-block-gap-hidden line decoration to collapse those retained placeholder lines.
  • Add a focused regression test covering blank lines before and after a rendered table.

Validation

  • npm test -- --run src/features/editor/extensions/livePreviewBlocks.test.ts src/features/editor/extensions/livePreviewInline.test.ts
  • git diff --check

@jsgrrchg jsgrrchg marked this pull request as ready for review May 17, 2026 11:40
@jsgrrchg jsgrrchg merged commit a612ec6 into main May 17, 2026
3 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.

1 participant