diff --git a/microsite/docusaurus.config.js b/microsite/docusaurus.config.js index 227f475a44..429a2b546f 100644 --- a/microsite/docusaurus.config.js +++ b/microsite/docusaurus.config.js @@ -69,10 +69,13 @@ module.exports = { ], ], markdown: { - preprocessor({ fileContent }) { - // Remove HTML comments from markdown files as they're not supported by MDX2 - return fileContent.replace(//gs, ''); - } + preprocessor({ filePath, fileContent }) { + // Replace HTML comments with empty strings in files that are not in the blog folder, + // as the syntax is backwards compatible with MDX2 in Docusarus. + if (!filePath.startsWith(`${__dirname}/blog`)) { + return fileContent.replace(//gs, ''); + } + }, }, webpack: { jsLoader: isServer => ({ diff --git a/microsite/scripts/pre-build.js b/microsite/scripts/pre-build.js index c925be3b1f..3b5bd4fb0b 100644 --- a/microsite/scripts/pre-build.js +++ b/microsite/scripts/pre-build.js @@ -30,7 +30,7 @@ async function main() { if (!existsSync(referencesDir)) { mkdirSync(referencesDir); writeFileSync(path.join(referencesDir, 'index.md'), PLACEHOLDER); - } + } } main().catch(error => {