diff --git a/package-lock.json b/package-lock.json index 8d1351186..0bd826050 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,7 @@ "jszip": "^3.10.1", "markdown-it": "^14.1.0", "markdown-it-anchor": "^9.2.0", + "markdown-it-footnote": "^4.0.0", "markdown-it-github-alerts": "^0.3.0", "markdown-it-task-lists": "^2.1.1", "mime-types": "^2.1.35", @@ -7060,6 +7061,12 @@ "markdown-it": "*" } }, + "node_modules/markdown-it-footnote": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/markdown-it-footnote/-/markdown-it-footnote-4.0.0.tgz", + "integrity": "sha512-WYJ7urf+khJYl3DqofQpYfEYkZKbmXmwxQV8c8mO/hGIhgZ1wOe7R4HLFNwqx7TjILbnC98fuyeSsin19JdFcQ==", + "license": "MIT" + }, "node_modules/markdown-it-github-alerts": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/markdown-it-github-alerts/-/markdown-it-github-alerts-0.3.0.tgz", diff --git a/package.json b/package.json index e3e045eb0..0ed905b51 100644 --- a/package.json +++ b/package.json @@ -105,6 +105,7 @@ "jszip": "^3.10.1", "markdown-it": "^14.1.0", "markdown-it-anchor": "^9.2.0", + "markdown-it-footnote": "^4.0.0", "markdown-it-github-alerts": "^0.3.0", "markdown-it-task-lists": "^2.1.1", "mime-types": "^2.1.35", diff --git a/src/lib/run.js b/src/lib/run.js index 8f4621f02..14c43c69c 100644 --- a/src/lib/run.js +++ b/src/lib/run.js @@ -4,7 +4,9 @@ import box from "dialogs/box"; import fsOperation from "fileSystem"; import markdownIt from "markdown-it"; import anchor from "markdown-it-anchor"; +import markdownItFootnote from "markdown-it-footnote"; import MarkdownItGitHubAlerts from "markdown-it-github-alerts"; +import markdownItTaskLists from "markdown-it-task-lists"; import mimeType from "mime-types"; import mustache from "mustache"; import path from "path-browserify"; @@ -362,6 +364,8 @@ async function run( .toLowerCase() .replace(/[^a-z0-9]+/g, "-"), }) + .use(markdownItTaskLists) + .use(markdownItFootnote) .render(file.session.getValue()); const doc = mustache.render($_markdown, { html, diff --git a/src/pages/changelog/changelog.js b/src/pages/changelog/changelog.js index e016df1bd..a72060567 100644 --- a/src/pages/changelog/changelog.js +++ b/src/pages/changelog/changelog.js @@ -5,6 +5,7 @@ import Page from "components/page"; import Ref from "html-tag-js/ref"; import actionStack from "lib/actionStack"; import markdownIt from "markdown-it"; +import markdownItFootnote from "markdown-it-footnote"; import markdownItTaskLists from "markdown-it-task-lists"; import helpers from "utils/helpers"; @@ -148,6 +149,7 @@ export default async function Changelog() { .replace(/@(\w+)/g, "[@$1](https://github.com/$1)"); md.use(markdownItTaskLists); + md.use(markdownItFootnote); const htmlContent = md.render(processedText); $content.innerHTML = htmlContent; } diff --git a/src/pages/plugin/plugin.js b/src/pages/plugin/plugin.js index 63bde9d14..2fbd5840d 100644 --- a/src/pages/plugin/plugin.js +++ b/src/pages/plugin/plugin.js @@ -12,6 +12,7 @@ import InstallState from "lib/installState"; import settings from "lib/settings"; import markdownIt from "markdown-it"; import anchor from "markdown-it-anchor"; +import markdownItFootnote from "markdown-it-footnote"; import MarkdownItGitHubAlerts from "markdown-it-github-alerts"; import markdownItTaskLists from "markdown-it-task-lists"; import Url from "utils/Url"; @@ -321,6 +322,7 @@ export default async function PluginInclude( .replace(/[^a-z0-9]+/g, "-"), }) .use(markdownItTaskLists) + .use(markdownItFootnote) .render(plugin.description), changelogs: plugin.changelogs ? markdownIt({ html: true, xhtmlOut: true }) @@ -333,6 +335,7 @@ export default async function PluginInclude( .replace(/[^a-z0-9]+/g, "-"), }) .use(markdownItTaskLists) + .use(markdownItFootnote) .render(plugin.changelogs) : null, purchased,