This article was written 309 days ago. The content of the article may be out of date.
Hexo is unable to render the to-do list using the hexo-renderer-marked. In order to solve this, Add the following code to the plugin code.
Add the code to /node_modules/hexo-renderer-kramed/lib/renderer.js
under your blog root dir.
1 2 3 4 5 6 7 8 9
| Renderer.prototype.listitem = function(text) { if (/^\s*\[[x ]\]\s*/.test(text)) { text = text.replace(/^\s*\[ \]\s*/, '<input type="checkbox"></input> ').replace(/^\s*\[x\]\s*/, '<input type="checkbox" checked></input> '); return '<li style="list-style: none">' + text + '</li>\n'; } else { return '<li>' + text + '</li>\n'; } };
|
Author: o_oyao
License: All articles in this blog are licensed under
CC BY-NC-SA 4.0 unless stating additionally.