From 19ee437f6428055f3e98a9f9aafb2dd8bda94690 Mon Sep 17 00:00:00 2001 From: yosukekato165 <40865734+yosukekato165@users.noreply.github.com> Date: Fri, 11 Aug 2023 01:17:07 +0900 Subject: [PATCH] fix(mdx-loader): ensure heading anchor slugs respect GitHub emoji behavior (#9202) Co-authored-by: YosukeKato --- packages/docusaurus-mdx-loader/src/processor.ts | 2 +- website/_dogfooding/_blog tests/2023-08-05.mdx | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 website/_dogfooding/_blog tests/2023-08-05.mdx diff --git a/packages/docusaurus-mdx-loader/src/processor.ts b/packages/docusaurus-mdx-loader/src/processor.ts index 2683b66693d6..5cc5699d6804 100644 --- a/packages/docusaurus-mdx-loader/src/processor.ts +++ b/packages/docusaurus-mdx-loader/src/processor.ts @@ -42,7 +42,7 @@ type SimpleProcessor = { const DEFAULT_OPTIONS: MDXOptions = { admonitions: true, rehypePlugins: [], - remarkPlugins: [emoji, headings, toc], + remarkPlugins: [headings, emoji, toc], beforeDefaultRemarkPlugins: [], beforeDefaultRehypePlugins: [], }; diff --git a/website/_dogfooding/_blog tests/2023-08-05.mdx b/website/_dogfooding/_blog tests/2023-08-05.mdx new file mode 100644 index 000000000000..180d6c6db846 --- /dev/null +++ b/website/_dogfooding/_blog tests/2023-08-05.mdx @@ -0,0 +1,8 @@ +--- +title: Ensure heading anchor slugs respect GitHub emoji behavior +date: 2023-08-05 +--- + +## :smiley: This is a friendly header + +## 😃 This is a friendly header (real smiley)