parent
b3c3180bab
commit
d486eef6cc
6 changed files with 75 additions and 3 deletions
|
|
@ -175,6 +175,15 @@ export class Compiler {
|
|||
return `<img src="${url}"data-origin="${href}" alt="${text}"${attrs}>`
|
||||
}
|
||||
|
||||
const CHECKED_RE = /^\[([ x])\] +/
|
||||
origin.listitem = renderer.listitem = function (text) {
|
||||
const checked = CHECKED_RE.exec(text)
|
||||
if (checked) {
|
||||
text = text.replace(CHECKED_RE, `<input type="checkbox" ${checked[1] === 'x' ? 'checked' : ''} />`)
|
||||
}
|
||||
return `<li>${text}</li>\n`
|
||||
}
|
||||
|
||||
renderer.origin = origin
|
||||
|
||||
return renderer
|
||||
|
|
|
|||
|
|
@ -91,6 +91,11 @@ kbd {
|
|||
vertical-align: middle;
|
||||
}
|
||||
|
||||
li input[type=checkbox] {
|
||||
margin: 0 0.2em 0.25em -1.6em;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* navbar */
|
||||
.app-nav {
|
||||
left: 0;
|
||||
|
|
|
|||
|
|
@ -100,9 +100,7 @@ body {
|
|||
}
|
||||
|
||||
.markdown-section figure,
|
||||
.markdown-section p,
|
||||
.markdown-section ul,
|
||||
.markdown-section ol {
|
||||
.markdown-section p {
|
||||
margin: 1.2em 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue