added checkbox support for markdown
This commit is contained in:
parent
6a43e2e44d
commit
0fe413e9ce
5 changed files with 25 additions and 10 deletions
|
@ -1,6 +1,7 @@
|
||||||
import markdownIt from "markdown-it" // rendering markdown
|
import markdownIt from "markdown-it" // rendering markdown
|
||||||
import markdownItTexMath from "markdown-it-texmath" // rendering mathematical expression
|
import markdownItTexMath from "markdown-it-texmath" // rendering mathematical expression
|
||||||
import markdownItAnchor from "markdown-it-anchor" // markdown anchor
|
import markdownItAnchor from "markdown-it-anchor" // markdown anchor
|
||||||
|
import markdownItTaskCheckbox from "markdown-it-task-checkbox"
|
||||||
import hljs from "highlight.js" // code block highlighting
|
import hljs from "highlight.js" // code block highlighting
|
||||||
import katex from "katex" // rendering mathematical expression
|
import katex from "katex" // rendering mathematical expression
|
||||||
import { nthIndex } from "./util"
|
import { nthIndex } from "./util"
|
||||||
|
@ -19,6 +20,7 @@ const md = markdownIt({
|
||||||
},
|
},
|
||||||
html: true,
|
html: true,
|
||||||
})
|
})
|
||||||
|
.use(markdownItTaskCheckbox)
|
||||||
.use(markdownItTexMath, {
|
.use(markdownItTexMath, {
|
||||||
engine: katex,
|
engine: katex,
|
||||||
delimiters: "dollars",
|
delimiters: "dollars",
|
||||||
|
|
1
source/generate/types/markdown-it-task-checkbox.d.ts
vendored
Normal file
1
source/generate/types/markdown-it-task-checkbox.d.ts
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
declare module "markdown-it-task-checkbox"
|
|
@ -32,17 +32,23 @@ A post have title, post date, tags, and content.
|
||||||
|
|
||||||
## List
|
## List
|
||||||
|
|
||||||
- Unordered list
|
- Unordered list item
|
||||||
- sub item
|
- Unordered list item
|
||||||
- sub item
|
- unordered list sub-item
|
||||||
- Unordered list
|
- unordered list sub-item
|
||||||
- Unordered list
|
- [ ] Unordered task list item (unchecked)
|
||||||
|
- [x] Unordered task list item (checked)
|
||||||
|
- [ ] unordered task list sub-item (unchecked)
|
||||||
|
- [x] unordered task list sub-item (checked)
|
||||||
|
|
||||||
1. Ordered list
|
1. Ordered list item
|
||||||
1. sub item
|
2. Ordered list item
|
||||||
2. sub item
|
1. ordered list sub item
|
||||||
2. Ordered list
|
2. ordered list sub item
|
||||||
3. Ordered list
|
3. [ ] Ordered list task item (unchecked)
|
||||||
|
4. [x] Ordered list task item (checked)
|
||||||
|
1. [ ] Ordered list task sub-item (unchecked)
|
||||||
|
2. [x] Ordered list task sub-item (checked)
|
||||||
|
|
||||||
## Code
|
## Code
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,7 @@
|
||||||
"eslint-plugin-json": "^3.1.0",
|
"eslint-plugin-json": "^3.1.0",
|
||||||
"eslint-plugin-react": "^7.27.1",
|
"eslint-plugin-react": "^7.27.1",
|
||||||
"jsdom": "^19.0.0",
|
"jsdom": "^19.0.0",
|
||||||
|
"markdown-it-task-checkbox": "^1.0.6",
|
||||||
"prettier": "^2.5.1",
|
"prettier": "^2.5.1",
|
||||||
"ts-node": "^10.4.0",
|
"ts-node": "^10.4.0",
|
||||||
"tslint-config-prettier": "^1.18.0",
|
"tslint-config-prettier": "^1.18.0",
|
||||||
|
|
|
@ -8011,6 +8011,11 @@ markdown-it-attrs@^4.1.0:
|
||||||
resolved "https://registry.yarnpkg.com/markdown-it-attrs/-/markdown-it-attrs-4.1.0.tgz#e27f023cd8731b15b4a5e971d51e6f45b3b947bc"
|
resolved "https://registry.yarnpkg.com/markdown-it-attrs/-/markdown-it-attrs-4.1.0.tgz#e27f023cd8731b15b4a5e971d51e6f45b3b947bc"
|
||||||
integrity sha512-xd1SuNQPArGYl3SN1bsOHRnmMenkqeLDbTR0udeyGMSFBnaOtxP4yz1SEKrjsV/XYFygFAeKFHgbbj6AwxbTfA==
|
integrity sha512-xd1SuNQPArGYl3SN1bsOHRnmMenkqeLDbTR0udeyGMSFBnaOtxP4yz1SEKrjsV/XYFygFAeKFHgbbj6AwxbTfA==
|
||||||
|
|
||||||
|
markdown-it-task-checkbox@^1.0.6:
|
||||||
|
version "1.0.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/markdown-it-task-checkbox/-/markdown-it-task-checkbox-1.0.6.tgz#9ebd7b6382e99162264605bc580f2ac118be4242"
|
||||||
|
integrity sha512-7pxkHuvqTOu3iwVGmDPeYjQg+AIS9VQxzyLP9JCg9lBjgPAJXGEkChK6A2iFuj3tS0GV3HG2u5AMNhcQqwxpJw==
|
||||||
|
|
||||||
markdown-it-texmath@^0.9.6:
|
markdown-it-texmath@^0.9.6:
|
||||||
version "0.9.6"
|
version "0.9.6"
|
||||||
resolved "https://registry.yarnpkg.com/markdown-it-texmath/-/markdown-it-texmath-0.9.6.tgz#a42b5cfebd0aea36c53367d501c21c2c875abe4f"
|
resolved "https://registry.yarnpkg.com/markdown-it-texmath/-/markdown-it-texmath-0.9.6.tgz#a42b5cfebd0aea36c53367d501c21c2c875abe4f"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue