Skip to content

Commit

Permalink
Merge 24ae51f into ffeca47
Browse files Browse the repository at this point in the history
  • Loading branch information
wkzcn committed Aug 9, 2017
2 parents ffeca47 + 24ae51f commit ce2b3c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ marked:
- **smartLists** - Use smarter list behavior than the original markdown.
- **smartypants** - Use "smart" typograhic punctuation for things like quotes and dashes.
- **modifyAnchors** - Use for transform anchorIds. if 1 to lowerCase and if 2 to upperCase.
- **autolink** - Enable autolink for URLs. E.g. `http://hexo.io` will become `<a herf="http://hexo.io">http://hexo.io</a>`.
- **autolink** - Enable autolink for URLs. E.g. `http://hexo.io` will become `<a href="http://hexo.io">http://hexo.io</a>`.

[Markdown]: http://daringfireball.net/projects/markdown/
[marked]: https://github.com/chjj/marked
4 changes: 2 additions & 2 deletions lib/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ require('util').inherits(Renderer, MarkedRenderer);
Renderer.prototype.listitem = function(text) {
var result;

if (/^\s*(<p>\s*)?\[[x ]\]\s*/i.test(text)) {
text = text.replace(/^\s*(<p>\s*)?\[ \]\s*/i, '<input type="checkbox"></input> ').replace(/^\s*(<p>\s*)?\[x\]\s*/i, '<input type="checkbox" checked></input> ');
if (/^\s*\[[x ]\]\s*/.test(text)) {
text = text.replace(/^\s*\[ \]\s*/, '<input type="checkbox" disabled></input> ').replace(/^\s*\[x\]\s*/, '<input type="checkbox" checked disabled></input> ');
result = '<li style="list-style: none">' + text + '</li>\n';
} else {
result = '<li>' + text + '</li>\n';
Expand Down

0 comments on commit ce2b3c1

Please sign in to comment.