Browse Source

docsify: 注入钩子,将katex不支持的公式替换为支持的公式

可能影响渲染效果
pull/1/head
Chen Leo 5 years ago
parent
commit
f4ec021a12
1 changed files with 12 additions and 1 deletions
  1. +12
    -1
      index.html

+ 12
- 1
index.html View File

@@ -16,7 +16,18 @@
window.$docsify = {
loadSidebar: 'content.md',
subMaxLevel: 2,
plugins: [],
plugins: [
//注入钩子,将katex目前不支持的公式环境替换为支持的
function (hook) {
hook.beforeEach(function (content) {
return content
.replace(/\\begin\{align\*\}/g, '\\begin{aligned}')
.replace(/\\end\{align\*\}/g, '\\end{aligned}')
.replace(/\\begin\{gather\*\}/g, '\\begin{gathered}')
.replace(/\\end\{gather\*\}/g, '\\end{gathered}');
});
}
],
name: 'Coursera吴恩达机器学习课程整理',
repo: 'https://github.com/scruel/ML-AndrewNg-Notes'
}


Loading…
Cancel
Save