Skip to content

Commit

Permalink
Fix regexp issues caused rendering problems
Browse files Browse the repository at this point in the history
When using brackets, the current markdown-it-texmath can't render
properly. This change fixes the incorrect regexp.

fix goessner#9
  • Loading branch information
shi-yan committed Nov 11, 2018
1 parent 5ccf0cf commit 45e266c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This extension is a comfortable tool for scientists, engineers and students with

View a [test table](https://goessner.github.io/markdown-it-texmath/index.html).

[try it our ...](https://goessner.github.io/markdown-it-texmath/markdown-it-texmath-demo.html)
[try it out ...](https://goessner.github.io/markdown-it-texmath/markdown-it-texmath-demo.html)

## Use with `node.js`

Expand Down
4 changes: 2 additions & 2 deletions texmath.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ texmath.rules = {
],
block: [
{ name: 'math_block_eqno',
rex: /\\\[\s*?([\s\S]+?)\\\]\s*?\(([^)$\r\n]+?)\)/gmy,
rex: /\\\[\s*?(.+?)\\\]\s*?\(([^)$\r\n]+?)\)/gmy,
tmpl: '<section class="eqno"><eqn>$1</eqn><span>($2)</span></section>',
tag: '\\['
},
{ name: 'math_block',
rex: /\\\[([\s\S]+?)\\\]/gmy,
rex: /\\\[(.+?)\\\]/gmy,
tmpl: '<section><eqn>$1</eqn></section>',
tag: '\\['
}
Expand Down

0 comments on commit 45e266c

Please sign in to comment.