rspress icon indicating copy to clipboard operation
rspress copied to clipboard

Replace containerSyntax with remark-directive

Open Copilot opened this issue 2 weeks ago • 6 comments

Summary

Replaces custom container parsing logic with remark-directive while maintaining backward compatibility for VuePress/Docusaurus syntax.

Related Issue

Related to issue about replacing containerSyntax with remark-directive implementation.

Changes

  • Dependencies: Moved remark-directive and mdast-util-directive to runtime dependencies
  • Plugin chain: Added remarkDirective before remarkContainerSyntax in the processing pipeline
  • Implementation: Refactored containerSyntax.ts to use remark-directive for standard syntax (e.g., :::tip) while preserving custom parsing for:
    • VuePress/Docusaurus plain text titles: ::: tip Custom Title
    • GitHub alerts: > [!TIP]
  • Whitespace normalization: Updated snapshots to reflect cleaner output (removed unnecessary leading newlines from remark-directive parsed content)

Checklist

  • [x] Tests updated (or not required).
  • [x] Documentation updated (or not required).
Original prompt

尝试将 containerSyntax 替换为 remark-directive 相关实现


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot avatar Nov 14 '25 07:11 Copilot

Deploy Preview for rspress-v2 ready!

Name Link
Latest commit 44ada49d17c79ae1b0f2007dde0826991c42d195
Latest deploy log https://app.netlify.com/projects/rspress-v2/deploys/6916d7b14a02bf000817081e
Deploy Preview https://deploy-preview-2762--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.

netlify[bot] avatar Nov 14 '25 07:11 netlify[bot]

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Nov 14 '25 07:11 CLAassistant

https://github.com/web-infra-dev/rspress/pull/2756#issuecomment-3528239140

SoonIter avatar Nov 14 '25 07:11 SoonIter

https://docusaurus.io/blog/releases/3.0#markdown

We plan to maintain consistency with docusaurus in the implementation of admonitions, to correctly support the directive syntax in the commonmark specification.

SoonIter avatar Nov 14 '25 07:11 SoonIter

https://github.com/web-infra-dev/rspress/issues/2550

SoonIter avatar Nov 14 '25 07:11 SoonIter

Rsdoctor Bundle Diff Analysis

Metric Current Baseline Change
📊 Total Size 14.3 MB 14.3 MB -68.0 B (-0.0%)
📄 JavaScript 13.7 MB 13.7 MB -68.0 B (-0.0%)
🎨 CSS 108.8 KB 108.8 KB 0 B (0.0%)
🌐 HTML 0 B 0 B N/A
📁 Other Assets 496.7 KB 496.7 KB 0 B (0.0%)

A detailed bundle diff analysis has been generated using Rsdoctor. You can download and view the interactive HTML report from the workflow artifacts.

📦 Download Link: Download Bundle Diff Report

Generated by Rsdoctor Action

github-actions[bot] avatar Nov 14 '25 07:11 github-actions[bot]