diff --git a/deps.ts b/deps.ts index 7199448..5b06b26 100644 --- a/deps.ts +++ b/deps.ts @@ -13,6 +13,8 @@ export { default as GitHubSlugger } from "https://esm.sh/github-slugger@2.0.0?pi export { default as markedAlert } from "https://esm.sh/marked-alert@2.0.1?pin=v135"; +export { default as markedFootnote } from "https://esm.sh/marked-footnote@1.2.2?pin=v135"; + export { gfmHeadingId } from "https://esm.sh/marked-gfm-heading-id@3.1.2?pin=v135"; export { default as Prism } from "https://esm.sh/prismjs@1.29.0?pin=v135"; diff --git a/mod.ts b/mod.ts index 4027e82..b7f852c 100644 --- a/mod.ts +++ b/mod.ts @@ -6,6 +6,7 @@ import { katex, Marked, markedAlert, + markedFootnote, Prism, sanitizeHtml, } from "./deps.ts"; @@ -14,6 +15,7 @@ export { CSS, KATEX_CSS, Marked }; Marked.marked.use(markedAlert()); Marked.marked.use(gfmHeadingId()); +Marked.marked.use(markedFootnote()); const slugger = new GitHubSlugger(); diff --git a/test/fixtures/footnote.html b/test/fixtures/footnote.html new file mode 100644 index 0000000..93533be --- /dev/null +++ b/test/fixtures/footnote.html @@ -0,0 +1,42 @@ +
Here is a simple footnote1. With some additional text after it2 and +without disrupting the blocks3.
+This is a footnote content. ↩
+A footnote on the label: "@#$%". ↩
+The first paragraph of the definition.
+Paragraph two of the definition.
+++A blockquote with +multiple lines.
+
a code block
Header 1 | +Header 2 | +
---|---|
Cell 1 | +Cell 2 | +
A `final` paragraph before list.
+