diff --git a/doc/README.md b/doc/README.md index 5260931..df67035 100644 --- a/doc/README.md +++ b/doc/README.md @@ -30,6 +30,9 @@ var y = 3 - [ ] a - [x] b +- I am just a simple list +- [x] checked +- [ ] not checked ## Contribute diff --git a/lib/renderer/toc-renderer.js b/lib/renderer/toc-renderer.js index 9102028..ee05521 100644 --- a/lib/renderer/toc-renderer.js +++ b/lib/renderer/toc-renderer.js @@ -19,12 +19,14 @@ TocRenderer.prototype.heading = function (text, level) { }; // TODO: move the to do list render to another file -TocRenderer.prototype.listitem = function(text) { +TocRenderer.prototype.listitem = function (text) { if (/^\s*\[[x ]\]\s*/.test(text)) { text = text - .replace(/^\s*\[ \]\s*/, '') - .replace(/^\s*\[x\]\s*/, ''); - return '
  • ' + text + '
  • '; + .replace(/^\s*\[ \]\s*/, + '') + .replace(/^\s*\[x\]\s*/, + ''); + return '
  • ' + text + '
  • '; } else { return '
  • ' + text + '
  • '; } diff --git a/public/assets/style/bundle.css b/public/assets/style/bundle.css index c278e4e..f4ceff0 100644 --- a/public/assets/style/bundle.css +++ b/public/assets/style/bundle.css @@ -35,6 +35,12 @@ ul { width: 70%; height: 100%; overflow: auto; } + .markdown-content li.task-list-item { + list-style: none; } + .markdown-content li.task-list-item .task-list-item-checkbox { + margin: 0 0.35em 0.25em -1.6em; + vertical-align: middle; + cursor: default; } .markdown-toc { position: fixed; diff --git a/views/assets/style/layout.scss b/views/assets/style/layout.scss index e3af807..29c6d02 100644 --- a/views/assets/style/layout.scss +++ b/views/assets/style/layout.scss @@ -48,6 +48,18 @@ ul{ height: 100%; overflow: auto; + + li.task-list-item { + list-style: none; + + .task-list-item-checkbox { + // copied from github... + margin: 0 0.35em 0.25em -1.6em; + vertical-align: middle; + // otherwise the cursor would show a forbidden icon + cursor: default; + } + } } .markdown-toc{