Skip to content

Docs: Add blank lines inside admonitions - #2128

Open
vzaidman wants to merge 2 commits into
mainfrom
export-D127668483
Open

vzaidman wants to merge 2 commits into
mainfrom
export-D127668483

Conversation

@vzaidman

Copy link
Copy Markdown
Contributor

Summary:
Adds a blank line after each opening :::note/:::info/:::caution and before each closing :::. Without them, prettier treats the closing ::: as part of a preceding list item and indents it, which breaks the admonition. Docusaurus recommends these blank lines when formatting Markdown with prettier.

This prepares the docs for formatting with prettier in the next diff. No rendered changes.

Changelog: [Internal]

Differential Revision: D127668483

Summary:
Extracts the markdown linting React Native uses at Meta into Metro's OSS setup, and fixes the existing issues.

- `yarn lint-markdown` runs `markdownlint-cli2` on `docs/*.md`. It runs on GitHub CI (`build-test-and-deploy.yml`), in the internal OSS Metro tests (`test-oss-metro-legocastle.sh`) and in `yarn test`.
- `.markdownlint-cli2.jsonc` enables the same rules as React Native's `.markdownlint-cli2.mjs`, e.g. `heading-increment`, `link-fragments` and `no-trailing-punctuation`. React Native's `relative-links` custom rule is not used: it includes the HTML of headings such as `` `unstable_middleware` <div class="label experimental">Experimental</div> `` in their anchors, so it rejects valid links like `./Configuration.md#unstable_middleware-experimental`. Links between pages are checked by the website build (`onBrokenLinks`/`onBrokenAnchors: throw`).

Fixes:
- `heading-increment`: "Merging Example" in `Configuration.md`, and the top-level sections of `LocalDevelopment.md` and `Troubleshooting.md`, are one level higher.
- `no-space-in-code`: the `schemeResolvers` type is a single code span, followed by a link to `CustomResolver`.
- `no-trailing-punctuation`: "File extensions are important!" in `PackageExports.md` loses the "!".

Heading anchors are unchanged.

Changelog: [Internal]

Differential Revision: D127663612
Summary:
Adds a blank line after each opening `:::note`/`:::info`/`:::caution` and before each closing `:::`. Without them, prettier treats the closing `:::` as part of a preceding list item and indents it, which breaks the admonition. Docusaurus recommends these blank lines when formatting Markdown with prettier.

This prepares the docs for formatting with prettier in the next diff. No rendered changes.

Changelog: [Internal]

Differential Revision: D127668483
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 29, 2026
@meta-codesync

meta-codesync Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

@vzaidman has exported this pull request. If you are a Meta employee, you can view the originating Diff in D127668483.

meta-codesync Bot pushed a commit that referenced this pull request Oct 29, 2026
Summary:

Adds a blank line after each opening `:::note`/`:::info`/`:::caution` and before each closing `:::`. Without them, prettier treats the closing `:::` as part of a preceding list item and indents it, which breaks the admonition. Docusaurus recommends these blank lines when formatting Markdown with prettier.

This prepares the docs for formatting with prettier in the next diff. No rendered changes.

Changelog: [Internal]

Differential Revision: D127668483
meta-codesync Bot pushed a commit that referenced this pull request Oct 29, 2026
Summary:

Adds a blank line after each opening `:::note`/`:::info`/`:::caution` and before each closing `:::`. Without them, prettier treats the closing `:::` as part of a preceding list item and indents it, which breaks the admonition. Docusaurus recommends these blank lines when formatting Markdown with prettier.

This prepares the docs for formatting with prettier in the next diff. No rendered changes.

Changelog: [Internal]

Differential Revision: D127668483

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported needs-meta-import

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant