Skip to content

Commit 88585fd

Browse files
feat: add markdown-it-footnote support in various components
feat: add task lists support for markdown preview
1 parent 2cb997e commit 88585fd

File tree

5 files changed

+17
-0
lines changed

5 files changed

+17
-0
lines changed

package-lock.json

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
"jszip": "^3.10.1",
106106
"markdown-it": "^14.1.0",
107107
"markdown-it-anchor": "^9.2.0",
108+
"markdown-it-footnote": "^4.0.0",
108109
"markdown-it-github-alerts": "^0.3.0",
109110
"markdown-it-task-lists": "^2.1.1",
110111
"mime-types": "^2.1.35",

src/lib/run.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import EditorFile from "./editorFile";
1818
import EditorManager from "./editorManager";
1919
import openFolder, { addedFolder } from "./openFolder";
2020
import appSettings from "./settings";
21+
import markdownItFootnote from "markdown-it-footnote";
22+
import markdownItTaskLists from "markdown-it-task-lists";
2123

2224
/**@type {Server} */
2325
let webServer;
@@ -362,6 +364,8 @@ async function run(
362364
.toLowerCase()
363365
.replace(/[^a-z0-9]+/g, "-"),
364366
})
367+
.use(markdownItTaskLists)
368+
.use(markdownItFootnote)
365369
.render(file.session.getValue());
366370
const doc = mustache.render($_markdown, {
367371
html,

src/pages/changelog/changelog.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Ref from "html-tag-js/ref";
66
import actionStack from "lib/actionStack";
77
import markdownIt from "markdown-it";
88
import markdownItTaskLists from "markdown-it-task-lists";
9+
import markdownItFootnote from "markdown-it-footnote";
910
import helpers from "utils/helpers";
1011

1112
export default async function Changelog() {
@@ -148,6 +149,7 @@ export default async function Changelog() {
148149
.replace(/@(\w+)/g, "[@$1](https://github.com/$1)");
149150

150151
md.use(markdownItTaskLists);
152+
md.use(markdownItFootnote);
151153
const htmlContent = md.render(processedText);
152154
$content.innerHTML = htmlContent;
153155
}

src/pages/plugin/plugin.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import markdownIt from "markdown-it";
1414
import anchor from "markdown-it-anchor";
1515
import MarkdownItGitHubAlerts from "markdown-it-github-alerts";
1616
import markdownItTaskLists from "markdown-it-task-lists";
17+
import markdownItFootnote from "markdown-it-footnote";
1718
import Url from "utils/Url";
1819
import helpers from "utils/helpers";
1920
import view from "./plugin.view.js";
@@ -321,6 +322,7 @@ export default async function PluginInclude(
321322
.replace(/[^a-z0-9]+/g, "-"),
322323
})
323324
.use(markdownItTaskLists)
325+
.use(markdownItFootnote)
324326
.render(plugin.description),
325327
changelogs: plugin.changelogs
326328
? markdownIt({ html: true, xhtmlOut: true })
@@ -333,6 +335,7 @@ export default async function PluginInclude(
333335
.replace(/[^a-z0-9]+/g, "-"),
334336
})
335337
.use(markdownItTaskLists)
338+
.use(markdownItFootnote)
336339
.render(plugin.changelogs)
337340
: null,
338341
purchased,

0 commit comments

Comments
 (0)