From 1c9ee6c5a7712207c31ba35f6a8015eb8804dbbd Mon Sep 17 00:00:00 2001 From: Ika Date: Mon, 27 Nov 2017 16:32:20 +0800 Subject: [PATCH] chore(website): ignore `` before passing into Docusaurus (#3326) prettier-ignore -->` before passing into Docusaurus --- website/siteConfig.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/website/siteConfig.js b/website/siteConfig.js index 5bcdf46f..be50e8de 100644 --- a/website/siteConfig.js +++ b/website/siteConfig.js @@ -47,7 +47,25 @@ const siteConfig = { algolia: { apiKey: process.env.ALGOLIA_PRETTIER_API_KEY, indexName: "prettier" - } + }, + markdownPlugins: [ + // ignore `` before passing into Docusaurus to avoid mis-parsing (#3322) + md => { + md.block.ruler.before( + "htmlblock", + "prettierignore", + (state, startLine) => { + const pos = state.bMarks[startLine]; + const max = state.eMarks[startLine]; + if (//.test(state.src.slice(pos, max))) { + state.line += 1; + return true; + } + return false; + } + ); + } + ] }; module.exports = siteConfig;