Skip to content

Commit aa47872

Browse files
committed
feat: add task list markdown support in plugin page
1 parent 400e204 commit aa47872

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
"markdown-it": "^14.1.0",
9999
"markdown-it-anchor": "^9.2.0",
100100
"markdown-it-github-alerts": "^0.3.0",
101+
"markdown-it-task-lists": "^2.1.1",
101102
"mime-types": "^2.1.35",
102103
"minimatch": "^9.0.4",
103104
"mustache": "^4.2.0",

src/pages/plugin/plugin.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import settings from "lib/settings";
1313
import markdownIt from "markdown-it";
1414
import anchor from "markdown-it-anchor";
1515
import MarkdownItGitHubAlerts from "markdown-it-github-alerts";
16+
import markdownItTaskLists from "markdown-it-task-lists";
1617
import Url from "utils/Url";
1718
import helpers from "utils/helpers";
1819
import view from "./plugin.view.js";
@@ -299,6 +300,7 @@ export default async function PluginInclude(
299300
.toLowerCase()
300301
.replace(/[^a-z0-9]+/g, "-"),
301302
})
303+
.use(markdownItTaskLists)
302304
.render(plugin.description),
303305
purchased,
304306
installed,

src/styles/markdown.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,4 +389,17 @@
389389
.markdown-alert.markdown-alert-caution .markdown-alert-title {
390390
color: var(--color-caution);
391391
}
392+
.task-list-item {
393+
list-style-type: none;
394+
label {
395+
font-weight: 400;
396+
}
397+
&+.task-list-item {
398+
margin-top: 0.25rem;
399+
}
400+
}
401+
ul:dir(rtl) .task-list-item-checkbox,
402+
ol:dir(rtl) .task-list-item-checkbox {
403+
margin: 0 -1.6em 0.25em 0.2em;
404+
}
392405
}

0 commit comments

Comments
 (0)