Skip to content

fix(cnwebsite): remove markdown.format 'detect' to fix JSX rendering in .md files#1025

Merged
sunnylqm merged 1 commit into
productionfrom
fix/remove-format-detect
May 18, 2026
Merged

fix(cnwebsite): remove markdown.format 'detect' to fix JSX rendering in .md files#1025
sunnylqm merged 1 commit into
productionfrom
fix/remove-format-detect

Conversation

@sunnylqm
Copy link
Copy Markdown

@sunnylqm sunnylqm commented May 18, 2026

问题

markdown.format: 'detect' 导致所有 .md 文件按纯 Markdown 解析,JSX 组件(<Tabs><TabItem> 等)不会被处理。影响 getting-started 及其他 55+ 个使用 Tabs 的页面。

EN 上游没有此配置,默认全部按 MDX 解析。

改动

  • 移除 cnwebsite/docusaurus.config.ts 中的 format: 'detect',与 EN 上游保持一致
  • 将 24 个版本文档中的 {#custom-id} 语法转换为 MDX v3 兼容的 {/*custom-id*/} 语法(backward-compatibility-*.md,版本 0.70-0.81)
  • 版本文档中的 HTML comments 均在 code fence 内,MDX 解析安全

验证

yarn build 通过(67s)。

Summary by CodeRabbit

  • Documentation

    • Updated internal reference anchors across multiple versions of backward-compatibility guides for Fabric Components and TurboModules.
    • Removed language-specific code examples from JavaScript standardization sections in select documentation versions.
  • Chores

    • Adjusted Docusaurus markdown configuration settings for diagram format handling.

Review Change Stack

…ream

- Remove 'format: detect' from docusaurus.config.ts so .md files are
  parsed as MDX (same as EN upstream), fixing JSX components like
  Tabs/TabItem not rendering in getting-started and 55+ other pages
- Convert {#custom-id} heading syntax to {/*custom-id*/} (MDX v3
  compatible) in 24 versioned docs (backward-compatibility-*.md,
  versions 0.70-0.81)
- HTML comments in versioned docs are inside code fences, safe in MDX

Build verified: yarn build passes (67s).
@netlify
Copy link
Copy Markdown

netlify Bot commented May 18, 2026

Deploy Preview for reactnativecn failed. Why did it fail? →

Name Link
🔨 Latest commit 3ac180a
🔍 Latest deploy log https://app.netlify.com/projects/reactnativecn/deploys/6a0ae54eee15b9000769ff92

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR modernizes the React Native documentation configuration and guides by removing Mermaid format auto-detection settings, migrating heading anchor syntax to a new standardized format across versioned docs (0.70–0.81), and removing outdated code re-export examples from backward-compatibility guides.

Changes

Documentation Configuration and Format Updates

Layer / File(s) Summary
Mermaid Configuration Simplification
cnwebsite/docusaurus.config.ts
Removes the explicit format: 'detect' option from Docusaurus markdown Mermaid settings, leaving mermaid: true enabled without format auto-detection.
iOS Heading Anchor Format Migration
cnwebsite/versioned_docs/version-{0.70..0.81}/the-new-architecture/backward-compatibility-{fabric-components,turbomodules}.md
iOS subsection heading anchors are systematically updated from the old {#dependencies-ios} syntax to the new {/_dependencies-ios_/} format across all versioned documentation files for both fabric-components and turbomodules guides, affecting internal navigation and linking.
JavaScript Re-export Pattern Cleanup
cnwebsite/versioned_docs/version-{0.72..0.81}/the-new-architecture/backward-compatibility-fabric-components.md
Removes Flow/TypeScript language-specific Tabs code examples showing re-export patterns via require('./MyComponentNativeComponent').default from versioned fabric-components guides, simplifying documentation on native component registration to focus on codegenNativeComponent usage.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

🐰 Anchors set and formats bright,
iOS docs now link just right,
No re-exports clogging views,
Mermaid flows with cleaner hues!
Versions aligned from old to new,
Documentation's morning dew.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change—removing markdown.format 'detect' to fix JSX rendering—which is the core fix in the primary configuration change. While the PR also includes documentation heading updates, the title focuses on the most impactful change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/remove-format-detect

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sunnylqm sunnylqm merged commit 6c93ae4 into production May 18, 2026
0 of 5 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