forked from liangliangyy/DjangoBlog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request liangliangyy#606 from liangliangyy/dev
增加数学公式支持
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
$(function () { | ||
MathJax.Hub.Config({ | ||
showProcessingMessages: false, //关闭js加载过程信息 | ||
messageStyle: "none", //不显示信息 | ||
extensions: ["tex2jax.js"], jax: ["input/TeX", "output/HTML-CSS"], displayAlign: "left", tex2jax: { | ||
inlineMath: [["$", "$"]], //行内公式选择$ | ||
displayMath: [["$$", "$$"]], //段内公式选择$$ | ||
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code', 'a'], //避开某些标签 | ||
}, "HTML-CSS": { | ||
availableFonts: ["STIX", "TeX"], //可选字体 | ||
showMathMenu: false //关闭右击菜单显示 | ||
} | ||
}); | ||
// 识别范围 => 文章内容、评论内容标签 | ||
const contentId = document.getElementById("content"); | ||
const commentId = document.getElementById("comments"); | ||
MathJax.Hub.Queue(["Typeset", MathJax.Hub, contentId, commentId]); | ||
}) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters