diff --git a/src/utils/markdown-it/markdown-it-texmath.js b/src/utils/markdown-it/markdown-it-texmath.js
index bd259589..85868951 100644
--- a/src/utils/markdown-it/markdown-it-texmath.js
+++ b/src/utils/markdown-it/markdown-it-texmath.js
@@ -102,7 +102,7 @@ texmath.rules = {
],
block: [
{ name: 'math_block',
- rex: /\\\[(.+?)\\\]/gmy,
+ rex: /\\\[(.+?)\\\]\s*$/gmy,
tmpl: '$1',
tag: '\\['
}
@@ -118,7 +118,7 @@ texmath.rules = {
],
block: [
{ name: 'math_block',
- rex: /`{3}math\s+?([^`]+?)\s+?`{3}/gmy,
+ rex: /`{3}math\s+?([^`]+?)\s+?`{3}\s*$/gmy,
tmpl: '$1',
tag: '```math'
}
@@ -143,7 +143,7 @@ texmath.rules = {
],
block: [
{ name: 'math_block',
- rex: /\${2}([^$]*?)\${2}/gmy,
+ rex: /\${2}([^$]*?)\${2}\s*$/gmy,
tmpl: '$1',
tag: '$$'
}