Skip to content

Commit ed62da8

Browse files
committed
support indented gitlab math block
1 parent 9fcd064 commit ed62da8

4 files changed

Lines changed: 15 additions & 2 deletions

File tree

mdx_math.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ def run(self, lines):
6363
math_blocks = []
6464

6565
for line_number, line in enumerate(lines):
66-
if line == '```math' and not inside_math_block:
66+
if line.strip() == '```math' and not inside_math_block:
6767
math_block_start = line_number
6868
inside_math_block = True
69-
if line == '```' and inside_math_block:
69+
if line.strip() == '```' and inside_math_block:
7070
math_blocks.append((math_block_start, line_number))
7171
inside_math_block = False
7272

test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def r(mkd_name, html_name, **config):
3030
test_standalone_latex_preview = r('standalone_latex', 'standalone_preview', add_preview=True)
3131
test_standalone_tex = r('standalone_tex', 'standalone')
3232
test_standalone_gitlab = r('standalone_gitlab', 'standalone_gitlab', use_gitlab_delimiters=True)
33+
test_standalone_gitlab_nested = r('standalone_gitlab_nested', 'standalone_gitlab_nested', use_gitlab_delimiters=True)
3334
test_begin_end = r('beginend', 'beginend')
3435
test_begin_end_preview = r('beginend', 'beginend_preview', add_preview=True)
3536
test_inline_asciimath = r('inline_asciimath', 'inline_asciimath', use_asciimath=True)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<ul>
2+
<li>in list:
3+
<script type="math/tex; mode=display">
4+
e^{i \varphi} =
5+
\cos \varphi + i \sin \varphi
6+
</script></li>
7+
</ul>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- in list:
2+
```math
3+
e^{i \varphi} =
4+
\cos \varphi + i \sin \varphi
5+
```

0 commit comments

Comments
 (0)