Skip to content

Commit

Permalink
Add support for task lists
Browse files Browse the repository at this point in the history
  • Loading branch information
GaelGirodon committed Sep 30, 2023
1 parent c50a9f2 commit 98ebd67
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 57 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ compiler and the following plugins to generate HTML code from Markdown:
- `markdown-it-mark` - Marked (`<mark>`) tag support
- `markdown-it-sub` - Subscript (`<sub>`) tag support
- `markdown-it-sup` - Superscript (`<sup>`) tag support
- `markdown-it-task-lists` - Task lists (`- [ ]` / `- [x]`) support
- `markdown-it-toc-done-right` - Table of contents (`[[toc]]`) support

Additional features also use the following packages:
Expand Down
115 changes: 62 additions & 53 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"ejs": "npm:neat-ejs@^3.1.9",
"fast-glob": "^3.3.1",
"highlight.js": "^11.8.0",
"markdown-it": "^13.0.1",
"markdown-it": "^13.0.2",
"markdown-it-abbr": "^1.0.4",
"markdown-it-anchor": "^8.6.7",
"markdown-it-container": "^3.0.0",
Expand All @@ -59,18 +59,19 @@
"markdown-it-mark": "^3.0.1",
"markdown-it-sub": "^1.0.0",
"markdown-it-sup": "^1.0.0",
"markdown-it-task-lists": "^2.1.1",
"markdown-it-toc-done-right": "^4.2.0",
"web-resource-inliner": "^6.0.1"
},
"devDependencies": {
"c8": "^8.0.1",
"chai": "^4.3.8",
"chai": "^4.3.10",
"clean-css": "^5.3.2",
"eslint": "^8.48.0",
"eslint": "^8.50.0",
"github-markdown-css": "^5.2.0",
"mocha": "^10.2.0",
"mocha-junit-reporter": "^2.2.1",
"prettier": "^3.0.2",
"prettier": "^3.0.3",
"uglify-js": "^3.17.4"
},
"engines": {
Expand Down
2 changes: 2 additions & 0 deletions src/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import ins from "markdown-it-ins";
import mark from "markdown-it-mark";
import sub from "markdown-it-sub";
import sup from "markdown-it-sup";
import taskLists from "markdown-it-task-lists";
import tocDoneRight from "markdown-it-toc-done-right";

import { randomId } from "./util.js";
Expand Down Expand Up @@ -84,6 +85,7 @@ export class Compiler {
.use(sub) // Subscript (<sub>) tag
.use(sup) // Superscript (<sup>) tag
.use(anchor, { level: 2 }) // Header anchors (permalinks)
.use(taskLists) // Task lists
.use(tocDoneRight, { level: [2, 3] }); // Table of contents

return this;
Expand Down

0 comments on commit 98ebd67

Please sign in to comment.