添加公式失败记

添加支持公式显示,卸载marked渲染器,安装markdown it plus渲染器

1
2
npm uninstall hexo-renderer-marked --save
npm install hexo-renderer-markdown-it-plus --save

配置中添加

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
markdown_it_plus:
highlight: true
html: true
xhtmlOut: true
breaks: true
langPrefix:
linkify: true
typographer:
quotes: “”‘’
plugins:
- plugin:
name: markdown-it-katex
enable: true
- plugin:
name: markdown-it-mark
enable: false

html头部添加css,或模板文件中

1
<link href="https://cdn.bootcss.com/KaTeX/0.7.1/katex.min.css" rel="stylesheet">

完成后渲染测试
然而实际情况如下

对比vscode插件的显示效果

一言难尽…
暂时还是用截图替代好了
以后有需求再改用支持mathjax渲染器