Skip to content

Commit

Permalink
Non need to scan for begin/end
Browse files Browse the repository at this point in the history
  • Loading branch information
facelessuser committed Jun 9, 2018
1 parent cb0cd34 commit 53bd194
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions js/katex_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

var katexMath = (function () {
var maths = document.querySelectorAll('.arithmatex'),
block_env = /\\begin\{([a-z]+\*?)\}.+?\\end\{\1\}/,
tex;

for (var i = 0; i < maths.length; i++) {
Expand All @@ -12,8 +11,7 @@ var katexMath = (function () {
(tex.startsWith('$') && tex.endsWith('$'))) {
katex.render(tex.slice(2, -2), maths[i], {'displayMode': false});
} else if ((tex.startsWith('\\[') && tex.endsWith('\\]')) ||
(tex.startsWith('$$') && tex.endsWith('$$')) ||
block_env.test(tex)) {
(tex.startsWith('$$') && tex.endsWith('$$'))) {
katex.render(tex.slice(2, -2), maths[i], {'displayMode': true});
}
}
Expand Down

0 comments on commit 53bd194

Please sign in to comment.