feat(mdxish): preserve blank line spacing in rendered output#1415
Draft
maximilianfalco wants to merge 2 commits intonextfrom
Draft
feat(mdxish): preserve blank line spacing in rendered output#1415maximilianfalco wants to merge 2 commits intonextfrom
maximilianfalco wants to merge 2 commits intonextfrom
Conversation
essentiall just stop squashing multiple \n into a single \n
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.
🎯 What does this PR do?
See this monorepo PR: https://github.com/readmeio/readme/pull/18047
The markdown parser collapses multiple blank lines between block elements into a single paragraph break, so extra vertical spacing in the source is lost. This PR restores that spacing so the rendered output matches what the author intended.
remarkRestoreBlankLinesremark plugin that detects position gaps in the mdast tree where blank lines were collapsed, and re-inserts empty paragraph nodesrehypeEmptyParagraphsToBrrehype plugin that converts those empty<p>elements (invisible due to margin collapse) into<br>elements for visible spacing🧪 QA tips
<br>elements📸 Screenshot or Loom