From cd4f97593b3bcd8956a69fad41ca60fe195fe956 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 2 Feb 2022 09:53:09 -0500 Subject: [PATCH] Add markdown footnotes. Fixes #561 (#562) --- package.json | 1 + src/shared/utils.ts | 2 ++ yarn.lock | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/package.json b/package.json index a57619f..4a20581 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "jwt-decode": "^3.1.2", "markdown-it": "^12.1.0", "markdown-it-container": "^3.0.0", + "markdown-it-footnote": "^3.0.3", "markdown-it-html5-embed": "^1.0.0", "markdown-it-sub": "^1.0.0", "markdown-it-sup": "^1.0.0", diff --git a/src/shared/utils.ts b/src/shared/utils.ts index 091e85a..8c29e4f 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -30,6 +30,7 @@ import { } from "lemmy-js-client"; import markdown_it from "markdown-it"; import markdown_it_container from "markdown-it-container"; +import markdown_it_footnote from "markdown-it-footnote"; import markdown_it_html5_embed from "markdown-it-html5-embed"; import markdown_it_sub from "markdown-it-sub"; import markdown_it_sup from "markdown-it-sup"; @@ -225,6 +226,7 @@ export const md = new markdown_it({ }) .use(markdown_it_sub) .use(markdown_it_sup) + .use(markdown_it_footnote) .use(markdown_it_html5_embed, { html5embed: { useImageSyntax: true, // Enables video/audio embed with ![]() syntax (default) diff --git a/yarn.lock b/yarn.lock index 0e3851b..1e7fd8d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4967,6 +4967,11 @@ markdown-it-container@^3.0.0: resolved "https://registry.yarnpkg.com/markdown-it-container/-/markdown-it-container-3.0.0.tgz#1d19b06040a020f9a827577bb7dbf67aa5de9a5b" integrity sha512-y6oKTq4BB9OQuY/KLfk/O3ysFhB3IMYoIWhGJEidXt1NQFocFK2sA2t0NYZAMyMShAGL6x5OPIbrmXPIqaN9rw== +markdown-it-footnote@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/markdown-it-footnote/-/markdown-it-footnote-3.0.3.tgz#e0e4c0d67390a4c5f0c75f73be605c7c190ca4d8" + integrity sha512-YZMSuCGVZAjzKMn+xqIco9d1cLGxbELHZ9do/TSYVzraooV8ypsppKNmUJ0fVH5ljkCInQAtFpm8Rb3eXSrt5w== + markdown-it-html5-embed@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/markdown-it-html5-embed/-/markdown-it-html5-embed-1.0.0.tgz#f36bedca1eb12ce4df2d53b5ec72f62ba5e094b3" -- 2.44.1