Skip to content

Commit ae2a093

Browse files
authored
fix(mdx): fix for html multi-line comments (#9100)
1 parent cc6d969 commit ae2a093

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

packages/docusaurus-mdx-loader/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"@docusaurus/utils": "3.0.0-alpha.0",
2525
"@docusaurus/utils-validation": "3.0.0-alpha.0",
2626
"@mdx-js/mdx": "^2.1.5",
27+
"@slorber/remark-comment": "^1.0.0",
2728
"escape-html": "^1.0.3",
2829
"estree-util-value-to-estree": "^2.1.0",
2930
"file-loader": "^6.2.0",
@@ -33,7 +34,6 @@
3334
"mdast-util-mdx": "^2.0.0",
3435
"mdast-util-to-string": "^3.0.0",
3536
"rehype-raw": "^6.1.1",
36-
"remark-comment": "^1.0.0",
3737
"remark-directive": "^2.0.1",
3838
"remark-emoji": "^2.2.0",
3939
"remark-gfm": "^3.0.1",

packages/docusaurus-mdx-loader/src/processor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ async function createProcessorFactory() {
7676
const {createProcessor: createMdxProcessor} = await import('@mdx-js/mdx');
7777
const {default: rehypeRaw} = await import('rehype-raw');
7878
const {default: gfm} = await import('remark-gfm');
79-
const {default: comment} = await import('remark-comment');
79+
// TODO using fork until PR merged: https://github.com/leebyron/remark-comment/pull/3
80+
const {default: comment} = await import('@slorber/remark-comment');
8081
const {default: directive} = await import('remark-directive');
8182

8283
// /!\ this method is synchronous on purpose

website/docusaurus.config.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,6 @@ module.exports = async function createConfigAsync() {
163163
// comments: false,
164164
},
165165
preprocessor: ({filePath, fileContent}) => {
166-
// TODO temporary quick fix for https://github.com/facebook/docusaurus/issues/9084
167-
fileContent = fileContent.replaceAll('<!--\n', '<!-- \n');
168-
169166
if (isDev) {
170167
// "vscode://file/${projectPath}${filePath}:${line}:${column}",
171168
// "webstorm://open?file=${projectPath}${filePath}&line=${line}&column=${column}",

yarn.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2571,6 +2571,15 @@
25712571
resolved "https://registry.yarnpkg.com/@slorber/react-ideal-image/-/react-ideal-image-0.0.12.tgz#5f867f9e10f2d82456568e8fd5bfb7673089c29c"
25722572
integrity sha512-u8KiDTEkMA7/KAeA5ywg/P7YG4zuKhWtswfVZDH8R8HXgQsFcHIYU2WaQnGuK/Du7Wdj90I+SdFmajSGFRvoKA==
25732573

2574+
"@slorber/remark-comment@^1.0.0":
2575+
version "1.0.0"
2576+
resolved "https://registry.yarnpkg.com/@slorber/remark-comment/-/remark-comment-1.0.0.tgz#2a020b3f4579c89dec0361673206c28d67e08f5a"
2577+
integrity sha512-RCE24n7jsOj1M0UPvIQCHTe7fI0sFL4S2nwKVWwHyVr/wI/H8GosgsJGyhnsZoGFnD/P2hLf1mSbrrgSLN93NA==
2578+
dependencies:
2579+
micromark-factory-space "^1.0.0"
2580+
micromark-util-character "^1.1.0"
2581+
micromark-util-symbol "^1.0.1"
2582+
25742583
"@slorber/static-site-generator-webpack-plugin@^4.0.7":
25752584
version "4.0.7"
25762585
resolved "https://registry.yarnpkg.com/@slorber/static-site-generator-webpack-plugin/-/static-site-generator-webpack-plugin-4.0.7.tgz#fc1678bddefab014e2145cbe25b3ce4e1cfc36f3"
@@ -13864,15 +13873,6 @@ relateurl@^0.2.7:
1386413873
resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9"
1386513874
integrity sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==
1386613875

13867-
remark-comment@^1.0.0:
13868-
version "1.0.0"
13869-
resolved "https://registry.yarnpkg.com/remark-comment/-/remark-comment-1.0.0.tgz#befe2fd5dde688d641542cd1206130e00b79a337"
13870-
integrity sha512-k8YPo5MGvl8l4gGxOH6Zk4Fa2AhDACN5eqKnKZcHDORZQS15hlnezlBHj2lqyDiqzApNmYOMTibkEJbMSKU25w==
13871-
dependencies:
13872-
micromark-factory-space "^1.0.0"
13873-
micromark-util-character "^1.1.0"
13874-
micromark-util-symbol "^1.0.1"
13875-
1387613876
remark-directive@^2.0.1:
1387713877
version "2.0.1"
1387813878
resolved "https://registry.yarnpkg.com/remark-directive/-/remark-directive-2.0.1.tgz#1c32d9df8d839a75ba3478112d21fe883635b48e"

0 commit comments

Comments
 (0)