markdown-it-texmath: add constraint to the end of the block equation

This commit is contained in:
Le Tan 2018-07-13 20:32:10 +08:00
parent d2e054994b
commit d06dcc36f5

View File

@ -102,7 +102,7 @@ texmath.rules = {
], ],
block: [ block: [
{ name: 'math_block', { name: 'math_block',
rex: /\\\[(.+?)\\\]/gmy, rex: /\\\[(.+?)\\\]\s*$/gmy,
tmpl: '<x-eqn class="tex-to-render">$1</x-eqn>', tmpl: '<x-eqn class="tex-to-render">$1</x-eqn>',
tag: '\\[' tag: '\\['
} }
@ -118,7 +118,7 @@ texmath.rules = {
], ],
block: [ block: [
{ name: 'math_block', { name: 'math_block',
rex: /`{3}math\s+?([^`]+?)\s+?`{3}/gmy, rex: /`{3}math\s+?([^`]+?)\s+?`{3}\s*$/gmy,
tmpl: '<x-eqn class="tex-to-render">$1</x-eqn>', tmpl: '<x-eqn class="tex-to-render">$1</x-eqn>',
tag: '```math' tag: '```math'
} }
@ -143,7 +143,7 @@ texmath.rules = {
], ],
block: [ block: [
{ name: 'math_block', { name: 'math_block',
rex: /\${2}([^$]*?)\${2}/gmy, rex: /\${2}([^$]*?)\${2}\s*$/gmy,
tmpl: '<x-eqn class="tex-to-render">$1</x-eqn>', tmpl: '<x-eqn class="tex-to-render">$1</x-eqn>',
tag: '$$' tag: '$$'
} }