chore(docs): pad admonitions with blank lines - #4676
Open
thetaPC wants to merge 1 commit into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Issue URL:
What is the current behavior?
Admonition content sits flush against its fences, with no blank lines:
Prettier's markdown parser doesn't know
:::is a Docusaurus directive. When a closing fence follows a list item directly, CommonMark reads it as a lazy continuation of that item, so Prettier re-indents it to the item's content column. That's what happened todocs/api/input-otp.md, which came out of.prettierignorein #4670 and got formatted for the first time:What is the new behavior?
Every admonition in
docs/andversioned_docs/version-v8/is padded, which keeps the closing fence a sibling of the opening one and out of reach of the list:904 of the 906 added lines are blank. The only two substantive changes are the dedented
:::indocs/api/input-otp.mdand its v8 copy, which is the bug this fixes.A blank line on its own isn't enough. Indented content after a blank line is still a loose-list continuation, so Prettier kept the two-space indent until the fence was realigned with its opener as well.
Does this introduce a breaking change?
Admonitions render identically. CommonMark allows up to three spaces of indentation on a block, so even the broken one parsed correctly. This was only ever a source-formatting problem.
Other information
N/A