Skip to content

fix(docs): use bracket syntax for admonition titles#5159

Merged
Simek merged 1 commit into
react:mainfrom
azizbecha:fix/admonition-title-bracket-syntax
Jun 28, 2026
Merged

fix(docs): use bracket syntax for admonition titles#5159
Simek merged 1 commit into
react:mainfrom
azizbecha:fix/admonition-title-bracket-syntax

Conversation

@azizbecha

@azizbecha azizbecha commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Fixes #5158.

Summary

Convert legacy space-separated admonition titles (:::warning Deprecated) to the MDX directive bracket form (:::warning[Deprecated]).

Docusaurus 3 / MDX 3 (with the future.v4 flag enabled in docusaurus.config.ts) no longer parse the space-title form, so remark-directive leaves the block as a plain paragraph and the ::: fences render as literal text (e.g. on Building For TV). Inline markdown inside the block still renders, which is why only the ::: markers looked broken.

The bracket form is already the convention across the rest of the docs (e.g. :::danger[Removed from React Native], :::note[Hint]); this migrates the remaining stragglers.

Before:
Screenshot 2026-06-28 at 8 17 28 PM

After:
Screenshot 2026-06-28 at 8 35 12 PM

Changes

  • 54 occurrences across 48 files — current docs/ and their website/versioned_docs/version-0.86/ copies.
  • CRLF line endings in the versioned files are preserved (only the admonition line changes; no whole-file churn).

Test plan

  • yarn prettier --check passes on all 48 changed files (the endOfLine: auto config leaves the CRLF files intact, label on a single line).
  • Verified the fix against the live site: every page using :::type <Title> (space) currently renders literal :::, while pages using the bracket form :::type[Title] render correctly — so the converted pages now match the working syntax.

Convert legacy space-separated admonition titles (`:::warning Deprecated`)
to the MDX directive bracket form (`:::warning[Deprecated]`).

Docusaurus 3 / MDX 3 (with the v4 future flag) no longer parse the
space-title form, so the `:::` fences rendered as literal text on pages
such as Building For TV. The bracket form is already used elsewhere in
the docs; this fixes the remaining stragglers.

54 occurrences across 48 files (docs/ and versioned_docs/version-0.86).
@meta-cla meta-cla Bot added the CLA Signed label Jun 28, 2026
@Simek

Simek commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

Nice catch! 👍 Looks like I have missed one admonition type in:

@Simek Simek left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the changes on the preview deployment, LGTM! 👍

@Simek Simek merged commit 40d7614 into react:main Jun 28, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Admonitions with space-separated titles (:::warning Deprecated) render as literal text

2 participants