Skip to content

Commit

Permalink
feat: add task list markdown support in plugin page
Browse files Browse the repository at this point in the history
  • Loading branch information
bajrangCoder committed Nov 4, 2024
1 parent 400e204 commit aa47872
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
"markdown-it": "^14.1.0",
"markdown-it-anchor": "^9.2.0",
"markdown-it-github-alerts": "^0.3.0",
"markdown-it-task-lists": "^2.1.1",
"mime-types": "^2.1.35",
"minimatch": "^9.0.4",
"mustache": "^4.2.0",
Expand Down
2 changes: 2 additions & 0 deletions src/pages/plugin/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import settings from "lib/settings";
import markdownIt from "markdown-it";
import anchor from "markdown-it-anchor";
import MarkdownItGitHubAlerts from "markdown-it-github-alerts";
import markdownItTaskLists from "markdown-it-task-lists";
import Url from "utils/Url";
import helpers from "utils/helpers";
import view from "./plugin.view.js";
Expand Down Expand Up @@ -299,6 +300,7 @@ export default async function PluginInclude(
.toLowerCase()
.replace(/[^a-z0-9]+/g, "-"),
})
.use(markdownItTaskLists)
.render(plugin.description),
purchased,
installed,
Expand Down
13 changes: 13 additions & 0 deletions src/styles/markdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -389,4 +389,17 @@
.markdown-alert.markdown-alert-caution .markdown-alert-title {
color: var(--color-caution);
}
.task-list-item {
list-style-type: none;
label {
font-weight: 400;
}
&+.task-list-item {
margin-top: 0.25rem;
}
}
ul:dir(rtl) .task-list-item-checkbox,
ol:dir(rtl) .task-list-item-checkbox {
margin: 0 -1.6em 0.25em 0.2em;
}
}

0 comments on commit aa47872

Please sign in to comment.