fix(mdx): fix for html multi-line comments (#9100)

This commit is contained in:
Sébastien Lorber 2023-06-23 19:33:03 +02:00 committed by GitHub
parent cc6d9696f0
commit ae2a09359a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 14 deletions

View file

@ -24,6 +24,7 @@
"@docusaurus/utils": "3.0.0-alpha.0",
"@docusaurus/utils-validation": "3.0.0-alpha.0",
"@mdx-js/mdx": "^2.1.5",
"@slorber/remark-comment": "^1.0.0",
"escape-html": "^1.0.3",
"estree-util-value-to-estree": "^2.1.0",
"file-loader": "^6.2.0",
@ -33,7 +34,6 @@
"mdast-util-mdx": "^2.0.0",
"mdast-util-to-string": "^3.0.0",
"rehype-raw": "^6.1.1",
"remark-comment": "^1.0.0",
"remark-directive": "^2.0.1",
"remark-emoji": "^2.2.0",
"remark-gfm": "^3.0.1",

View file

@ -76,7 +76,8 @@ async function createProcessorFactory() {
const {createProcessor: createMdxProcessor} = await import('@mdx-js/mdx');
const {default: rehypeRaw} = await import('rehype-raw');
const {default: gfm} = await import('remark-gfm');
const {default: comment} = await import('remark-comment');
// TODO using fork until PR merged: https://github.com/leebyron/remark-comment/pull/3
const {default: comment} = await import('@slorber/remark-comment');
const {default: directive} = await import('remark-directive');
// /!\ this method is synchronous on purpose

View file

@ -163,9 +163,6 @@ module.exports = async function createConfigAsync() {
// comments: false,
},
preprocessor: ({filePath, fileContent}) => {
// TODO temporary quick fix for https://github.com/facebook/docusaurus/issues/9084
fileContent = fileContent.replaceAll('<!--\n', '<!-- \n');
if (isDev) {
// "vscode://file/${projectPath}${filePath}:${line}:${column}",
// "webstorm://open?file=${projectPath}${filePath}&line=${line}&column=${column}",

View file

@ -2571,6 +2571,15 @@
resolved "https://registry.yarnpkg.com/@slorber/react-ideal-image/-/react-ideal-image-0.0.12.tgz#5f867f9e10f2d82456568e8fd5bfb7673089c29c"
integrity sha512-u8KiDTEkMA7/KAeA5ywg/P7YG4zuKhWtswfVZDH8R8HXgQsFcHIYU2WaQnGuK/Du7Wdj90I+SdFmajSGFRvoKA==
"@slorber/remark-comment@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@slorber/remark-comment/-/remark-comment-1.0.0.tgz#2a020b3f4579c89dec0361673206c28d67e08f5a"
integrity sha512-RCE24n7jsOj1M0UPvIQCHTe7fI0sFL4S2nwKVWwHyVr/wI/H8GosgsJGyhnsZoGFnD/P2hLf1mSbrrgSLN93NA==
dependencies:
micromark-factory-space "^1.0.0"
micromark-util-character "^1.1.0"
micromark-util-symbol "^1.0.1"
"@slorber/static-site-generator-webpack-plugin@^4.0.7":
version "4.0.7"
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:
resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9"
integrity sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==
remark-comment@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/remark-comment/-/remark-comment-1.0.0.tgz#befe2fd5dde688d641542cd1206130e00b79a337"
integrity sha512-k8YPo5MGvl8l4gGxOH6Zk4Fa2AhDACN5eqKnKZcHDORZQS15hlnezlBHj2lqyDiqzApNmYOMTibkEJbMSKU25w==
dependencies:
micromark-factory-space "^1.0.0"
micromark-util-character "^1.1.0"
micromark-util-symbol "^1.0.1"
remark-directive@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/remark-directive/-/remark-directive-2.0.1.tgz#1c32d9df8d839a75ba3478112d21fe883635b48e"