Make sure you have existed markdown renderer uninstalled:
hexo-renderer-marked- The default markdown renderer shipped with Hexo.
hexo-renderer-markdown-it- Another official markdown renderer made by Hexo.
hexo-lute with following command:
$ npm i hexo-lute --save # yarn add hexo-lute # if you prefer yarn
The default behavior of
hexo-lute is nearly the same as
hexo-renderer-marked with default configuration.
You can configure this plugin in
_config.yml to enable extra features.
lute: gfm: true # Enabled by default breaks: true # Enabled by default header_id: true # Enabled by default autolink: true # Enabled by default emoji: false # Disabled by default prepend_root: false # Disabled by default sanitize: false # Disabled by default lazyload: false # Disabled by default lazyload_src: '' github_todo_list: false # Disabled by default github_todo_list_class: 'task-list' fix_term_typo: false # Disabled by default auto_space: false # Disabled by default chinese_punct: false # Disabled by default
gfm: GitHub flavored markdown
breaks: Treats soft break as a hard break, just like GitHub Issues.
header_id: Insert header id, e.g.
<h1 id="text">text</h1>. Useful for inserting anchor link to each paragraph with a heading.
autolink: Enable autolink for URLs. E.g.
emoji: Emoji support. E.g.
config.rootvalue to internal image url & relative link.
sanitize: Basic XSS filter based on bluemonday. Please just don't rely on it.
lazyload: Enable lazyload for image. The original
srcwill then become
lazyload_src: Set a new
data-src. Useful for a placeholder (small "loading" gif things).
lazyloadis set to
lazyload_srcis unset or empty,
data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=will be use then.
github_todo_list: GFM Todo List support.
github_todo_list_class: The class name for GFM Todo List support, useful for styling.
fix_term_typo: Enable some coding term correction (e.g.
Github => GitHub,
jquery => jQuery, etc.)
auto_space: Add a space between CJK character and other characters.
chinese_punct: Replace the English punctuation to Chinese punctuation (punctuation between Chinese words only).
Benchmark ✓ hexo-lute (324ms) ✓ hexo-renderer-marked (41ms)
It shows that
hexo-lute is 7x slower than
hexo-lute could be faster under specific circumstances (shorter & simpler posts).