Skip to content

docs: add prettier-ignore to wrapCode examples in code-blocks documentation#2974

Merged
SoonIter merged 3 commits intomainfrom
vk/32de-
Jan 7, 2026
Merged

docs: add prettier-ignore to wrapCode examples in code-blocks documentation#2974
SoonIter merged 3 commits intomainfrom
vk/32de-

Conversation

@SoonIter
Copy link
Copy Markdown
Member

@SoonIter SoonIter commented Jan 7, 2026

Summary

Related Issue

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

AI Summary

What changed

Added <!-- prettier-ignore --> comments to the wrapCode code block examples in both English and Chinese documentation files (website/docs/en/guide/use-mdx/code-blocks.mdx and website/docs/zh/guide/use-mdx/code-blocks.mdx).

Why

The code examples demonstrating the wrapCode meta attribute were being automatically formatted by Prettier, which split the intentionally long single-line code into multiple lines. This defeated the purpose of the examples, which are meant to show how wrapCode handles long lines of code that wrap within the code block.

Implementation details

  • Added <!-- prettier-ignore --> comment before each of the 4 affected code blocks (2 per language file)
  • Merged the split code back into single lines as originally intended
  • The examples now correctly demonstrate a long line of code that will wrap when rendered with the wrapCode attribute

This PR was written using Vibe Kanban


```javascript



```ts wrapCode
const longLine =
  '这是一行很长的代码,当存在 wrapCode meta 属性时会自动换行显示';



```

这个 mdx 在编辑的本意是想使用 ​

```ts


wrapCode
const longLine = '这是一行很长的代码,当存在 wrapCode meta 属性时会自动换行显示';


```

但是由于 prettier 的格式化导致自动换行了,你能加入 prettier ignore 来让这一行的修改变为原本的模样吗​
\`\`\`
- **中文文档** (`website/docs/zh/guide/use-mdx/code-blocks.mdx`): 第 227 行和第 236 行
- **英文文档** (`website/docs/en/guide/use-mdx/code-blocks.mdx`): 第 227 行和第 236 行
Copilot AI review requested due to automatic review settings January 7, 2026 11:31
@netlify
Copy link
Copy Markdown

netlify Bot commented Jan 7, 2026

Deploy Preview for rspress-v2 ready!

Name Link
🔨 Latest commit 674c541
🔍 Latest deploy log https://app.netlify.com/projects/rspress-v2/deploys/695e4584411b7800084b8a8a
😎 Deploy Preview https://deploy-preview-2974--rspress-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@SoonIter SoonIter changed the title 更新 ```ts wrapCode 文档 (vibe-kanban) docs: add prettier-ignore to wrapCode examples in code-blocks documentation Jan 7, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds prettier-ignore comments to prevent Prettier from automatically formatting long code lines in the documentation examples for the wrapCode feature. The original intent was to show a single long line of code that would wrap when the wrapCode meta attribute is applied, but Prettier was automatically breaking these lines during formatting, which undermined the demonstration.

Key changes:

  • Added <!-- prettier-ignore --> comments before code block examples in both language versions
  • Consolidated wrapped code lines back into single long lines to properly demonstrate the wrapCode feature

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
website/docs/zh/guide/use-mdx/code-blocks.mdx Added prettier-ignore comments and consolidated code examples to single lines in Chinese documentation
website/docs/en/guide/use-mdx/code-blocks.mdx Added prettier-ignore comments and consolidated code examples to single lines in English documentation

I've completed my review of this pull request. The changes are appropriate and correctly implement the intended fix. The prettier-ignore comments are properly placed to prevent automatic formatting of the example code, allowing the documentation to accurately demonstrate how the wrapCode feature works with long single lines of code. Both the Chinese and English versions have been updated consistently.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 7, 2026

Rsdoctor Bundle Diff Analysis

Found 3 projects in monorepo, 3 projects with changes.

📊 Quick Summary
Project Total Size Change
node 9.5 MB -79.0 B (-0.0%)
web 15.3 MB -220.0 B (-0.0%)
node_md 1.2 MB +184.0 B (0.0%)
📋 Detailed Reports (Click to expand)

📁 node

Path: website/doc_build/diff-rsdoctor/node/rsdoctor-data.json

📌 Baseline Commit: 57100d81c7 | PR: #2972

Metric Current Baseline Change
📊 Total Size 9.5 MB 9.5 MB -79.0 B (-0.0%)
📄 JavaScript 0 B 0 B 0
🎨 CSS 0 B 0 B 0
🌐 HTML 9.5 MB 9.5 MB -79.0 B (-0.0%)
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: node Bundle Diff

📁 web

Path: website/doc_build/diff-rsdoctor/web/rsdoctor-data.json

📌 Baseline Commit: 57100d81c7 | PR: #2972

Metric Current Baseline Change
📊 Total Size 15.3 MB 15.3 MB -220.0 B (-0.0%)
📄 JavaScript 14.6 MB 14.6 MB -208.0 B (-0.0%)
🎨 CSS 128.7 KB 128.7 KB 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 555.7 KB 555.7 KB -12.0 B (-0.0%)

📦 Download Diff Report: web Bundle Diff

📁 node_md

Path: website/doc_build/diff-rsdoctor/node_md/rsdoctor-data.json

📌 Baseline Commit: 57100d81c7 | PR: #2972

Metric Current Baseline Change
📊 Total Size 1.2 MB 1.2 MB +184.0 B (0.0%)
📄 JavaScript 0 B 0 B 0
🎨 CSS 0 B 0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 1.2 MB 1.2 MB +184.0 B (0.0%)

📦 Download Diff Report: node_md Bundle Diff

Generated by Rsdoctor GitHub Action

@SoonIter SoonIter requested a review from Timeless0911 January 7, 2026 11:44
@SoonIter SoonIter enabled auto-merge (squash) January 7, 2026 11:51
@SoonIter SoonIter merged commit 7dcc66a into main Jan 7, 2026
8 checks passed
@SoonIter SoonIter deleted the vk/32de- branch January 7, 2026 11:51
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.

3 participants