From dda89f90d4a69b010f5a6c16327da23523e17ba4 Mon Sep 17 00:00:00 2001 From: David Anson Date: Mon, 2 Jun 2025 22:07:21 -0700 Subject: [PATCH] Update demo web page to remove recognized front matter from rendered HTML output. --- demo/browser-exports.mjs | 1 + demo/default.js | 1 + 2 files changed, 2 insertions(+) diff --git a/demo/browser-exports.mjs b/demo/browser-exports.mjs index 42adabcb..3ed596ca 100644 --- a/demo/browser-exports.mjs +++ b/demo/browser-exports.mjs @@ -2,6 +2,7 @@ export { applyFixes, getVersion } from "markdownlint"; export { lint as lintSync } from "markdownlint/sync"; +export { frontMatterRe } from "markdownlint/helpers"; export { compile, parse, postprocess, preprocess } from "micromark"; export { directive, directiveHtml } from "micromark-extension-directive"; export { gfmAutolinkLiteral, gfmAutolinkLiteralHtml } from "micromark-extension-gfm-autolink-literal"; diff --git a/demo/default.js b/demo/default.js index 1f58347d..8f68a027 100644 --- a/demo/default.js +++ b/demo/default.js @@ -49,6 +49,7 @@ // Renders Markdown to HTML function render(markdown) { + markdown = markdown.replace(markdownlint.frontMatterRe, ""); const match = /^\?renderer=([a-z-]+)$/.exec(globalThis.location.search); const renderer = match ? match[1] : "micromark"; if (renderer === "markdown-it") {