ORIGIN

Hexo To-Do List unable to render properly

HexoBlog 1 min131 words
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
// Support To-Do List
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';
}
};
TOP
COMMENT
  • ABOUT
  • |
o_oyao
  The Jigsaw puzzle is incomplete with even one missing piece. And I want to be the last piece to make the puzzle complete.
Like my post?
Default QR Code
made with ❤️ by o_oyao
©o_oyao 2019-2024

|