Skip to content

Commit

Permalink
add \displaystyle before display style TeX math
Browse files Browse the repository at this point in the history
  • Loading branch information
sun123zxy committed Feb 25, 2024
1 parent 10937e5 commit 9feebce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,13 @@ module.exports = function math_plugin(md, options) {
options = options || {};

var inlineRenderer = function(tokens, idx){
return '<img eeimg="1" src="//www.zhihu.com/equation?tex=' + encodeURIComponent(tokens[idx].content) + '" alt="' + escapeHtml(replaceNl(tokens[idx].content)).trim() + '"/>'
return '<img eeimg="1" src="//www.zhihu.com/equation?tex=' + encodeURIComponent(tokens[idx].content)
+ '" alt="' + escapeHtml(replaceNl(tokens[idx].content)).trim() + '"/>'
};

var blockRenderer = function(tokens, idx){
return '<p><img eeimg="1" src="//www.zhihu.com/equation?tex=' + encodeURIComponent(tokens[idx].content) + '" alt="' + escapeHtml(replaceNl(tokens[idx].content)).trim() + '"/></p>'
return '<p><img eeimg="1" src="//www.zhihu.com/equation?tex=' + encodeURIComponent('\\displaystyle ' + tokens[idx].content)
+ '" alt="' + escapeHtml(replaceNl('\\displaystyle ' + tokens[idx].content)).trim() + '"/></p>'
}

var imageRenderer = function(tokens, idx) {
Expand Down

0 comments on commit 9feebce

Please sign in to comment.