diff --git a/tests/fixtures/admon.md b/tests/fixtures/admon.md index 91057a5..083d0b9 100644 --- a/tests/fixtures/admon.md +++ b/tests/fixtures/admon.md @@ -292,3 +292,24 @@ MKdocs Open Collapsible Sections

content

. + +Indented by 4 spaces +. + ??? note + content +. +
??? note
+    content
+
+. + +Indented by 4 spaces, DISABLE-CODEBLOCKS +. + ??? note + content +. +
+

Note

+

content

+
+. diff --git a/tests/fixtures/amsmath.md b/tests/fixtures/amsmath.md index ba21544..ed83488 100644 --- a/tests/fixtures/amsmath.md +++ b/tests/fixtures/amsmath.md @@ -220,4 +220,29 @@ equation environment, in list: & x_0 \quad && \text{valor inicial} \quad && 0\leq x_0 <m \end{alignat*} -. \ No newline at end of file +. + +Indented by 4 spaces +. + \begin{equation} + a = 1 + \end{equation} +. +
\begin{equation}
+a = 1
+\end{equation}
+
+. + +Indented by 4 spaces, DISABLE-CODEBLOCKS +. + \begin{equation} + a = 1 + \end{equation} +. +
+\begin{equation} + a = 1 + \end{equation} +
+. diff --git a/tests/fixtures/attrs.md b/tests/fixtures/attrs.md index 27221a2..b6d3890 100644 --- a/tests/fixtures/attrs.md +++ b/tests/fixtures/attrs.md @@ -1,11 +1,3 @@ -block indented * 4 is not a block -. - {#a .a b=c} -. -
{#a .a b=c}
-
-. - block with preceding text is not a block . {#a .a b=c} a @@ -248,3 +240,21 @@ spans: merge attributes .

a

. + +Indented by 4 spaces +. + {#a .a b=c} + # head +. +
{#a .a b=c}
+# head
+
+. + +Indented by 4 spaces, DISABLE-CODEBLOCKS +. + {#a .a b=c} + # head +. +

head

+. diff --git a/tests/fixtures/colon_fence.md b/tests/fixtures/colon_fence.md index b04e0e2..c2ac36a 100644 --- a/tests/fixtures/colon_fence.md +++ b/tests/fixtures/colon_fence.md @@ -421,3 +421,26 @@ yyy yyy . + + +Indented by 4 spaces +. + :::name + foo + ::: +. +
:::name
+foo
+:::
+
+. + +Indented by 4 spaces, DISABLE-CODEBLOCKS +. + :::name + foo + ::: +. +
foo
+
+. diff --git a/tests/fixtures/container.md b/tests/fixtures/container.md index 9475b6a..10382b7 100644 --- a/tests/fixtures/container.md +++ b/tests/fixtures/container.md @@ -284,3 +284,27 @@ yyy

yyy :::

. + + +Indented by 4 spaces +. + ::: name + content + ::: +. +
::: name
+content
+:::
+
+. + +Indented by 4 spaces, DISABLE-CODEBLOCKS +. + ::: name + content + ::: +. +
+

content

+
+. diff --git a/tests/fixtures/deflist.md b/tests/fixtures/deflist.md index a32952d..dfc20db 100644 --- a/tests/fixtures/deflist.md +++ b/tests/fixtures/deflist.md @@ -245,3 +245,27 @@ test .

test

. + +Indented by 4 spaces +. + Term 1 + + : Definition 1 +. +
Term 1
+
+: Definition 1
+
+. + +Indented by 4 spaces, DISABLE-CODEBLOCKS +. + Term 1 + + : Definition 1 +. +
+
Term 1
+
Definition 1
+
+. diff --git a/tests/fixtures/dollar_math.md b/tests/fixtures/dollar_math.md index c6554ec..08a2e90 100644 --- a/tests/fixtures/dollar_math.md +++ b/tests/fixtures/dollar_math.md @@ -562,3 +562,21 @@ $$1+1=2$$ (a b) 1+1=2 . + + +Indented by 4 spaces +. + $$a$$ +. +
$$a$$
+
+. + +Indented by 4 spaces, DISABLE-CODEBLOCKS +. + $$a$$ +. +
+a +
+. diff --git a/tests/fixtures/field_list.md b/tests/fixtures/field_list.md index 73b633c..6359f6f 100644 --- a/tests/fixtures/field_list.md +++ b/tests/fixtures/field_list.md @@ -363,3 +363,28 @@ other

. + + +Indented by 4 spaces +. + :name: text + indented +. +
:name: text
+    indented
+
+. + +Indented by 4 spaces, DISABLE-CODEBLOCKS +. + :name: text + indented +. +
+
name
+
+

text +indented

+
+
+. diff --git a/tests/fixtures/footnote.md b/tests/fixtures/footnote.md index b0643e1..df7cbfa 100644 --- a/tests/fixtures/footnote.md +++ b/tests/fixtures/footnote.md @@ -344,3 +344,31 @@ b . + +Indented by 4 spaces +. + [^1] + + [^1]: footnote +. +
[^1]
+
+[^1]: footnote
+
+. + +Indented by 4 spaces, DISABLE-CODEBLOCKS +. + [^1] + + [^1]: footnote +. +

[1]

+
+
+
    +
  1. footnote ↩︎

    +
  2. +
+
+. diff --git a/tests/fixtures/myst_block.md b/tests/fixtures/myst_block.md index 90bf9d3..1ec05e3 100644 --- a/tests/fixtures/myst_block.md +++ b/tests/fixtures/myst_block.md @@ -147,3 +147,32 @@ def -->
def --> . + + +Indented by 4 spaces +. + +++ + + % abc + + (a)= +. +
+++
+
+% abc
+
+(a)=
+
+. + +Indented by 4 spaces, DISABLE-CODEBLOCKS +. + +++ + + % abc + + (a)= +. +
+
(a)=
+. diff --git a/tests/fixtures/texmath_bracket.md b/tests/fixtures/texmath_bracket.md index 330f4cb..2f00e07 100644 --- a/tests/fixtures/texmath_bracket.md +++ b/tests/fixtures/texmath_bracket.md @@ -385,3 +385,28 @@ display equation in blockquote. (valid=True)

in blockquote.

. + +Indented by 4 spaces +. + \[ + a = 1 + \] +. +
\[
+a = 1
+\]
+
+. + +Indented by 4 spaces, DISABLE-CODEBLOCKS +. + \[ + a = 1 + \] +. +
+ + a = 1 + +
+. diff --git a/tests/fixtures/texmath_dollar.md b/tests/fixtures/texmath_dollar.md index bada6fe..26357b3 100644 --- a/tests/fixtures/texmath_dollar.md +++ b/tests/fixtures/texmath_dollar.md @@ -436,3 +436,21 @@ $x $ $ x$ $x $

. + + +Indented by 4 spaces +. + $$a$$ +. +
$$a$$
+
+. + +Indented by 4 spaces, DISABLE-CODEBLOCKS +. + $$a$$ +. +
+a +
+. diff --git a/tests/test_admon.py b/tests/test_admon.py index 8e246c4..f0ef479 100644 --- a/tests/test_admon.py +++ b/tests/test_admon.py @@ -16,6 +16,8 @@ ) def test_all(line, title, input, expected): md = MarkdownIt("commonmark").use(admon_plugin) + if "DISABLE-CODEBLOCKS" in title: + md.disable("code") md.options["xhtmlOut"] = False text = md.render(input) print(text) diff --git a/tests/test_amsmath.py b/tests/test_amsmath.py index fe48cf1..c619920 100644 --- a/tests/test_amsmath.py +++ b/tests/test_amsmath.py @@ -50,6 +50,8 @@ def test_custom_renderer(data_regression): ) def test_fixtures(line, title, input, expected): md = MarkdownIt("commonmark").use(amsmath_plugin) + if "DISABLE-CODEBLOCKS" in title: + md.disable("code") md.options["xhtmlOut"] = False text = md.render(input) print(text) diff --git a/tests/test_attrs.py b/tests/test_attrs.py index 612fc27..2e0bd58 100644 --- a/tests/test_attrs.py +++ b/tests/test_attrs.py @@ -14,6 +14,8 @@ ) def test_attrs(line, title, input, expected): md = MarkdownIt("commonmark").use(attrs_plugin, spans=True).use(attrs_block_plugin) + if "DISABLE-CODEBLOCKS" in title: + md.disable("code") md.options["xhtmlOut"] = False text = md.render(input) print(text) diff --git a/tests/test_colon_fence.py b/tests/test_colon_fence.py index d520906..fee609b 100644 --- a/tests/test_colon_fence.py +++ b/tests/test_colon_fence.py @@ -13,6 +13,8 @@ @pytest.mark.parametrize("line,title,input,expected", read_fixture_file(FIXTURE_PATH)) def test_fixtures(line, title, input, expected): md = MarkdownIt("commonmark").use(colon_fence_plugin) + if "DISABLE-CODEBLOCKS" in title: + md.disable("code") md.options["xhtmlOut"] = False text = md.render(input) try: diff --git a/tests/test_container.py b/tests/test_container.py index daf2ce6..3c4d6ed 100644 --- a/tests/test_container.py +++ b/tests/test_container.py @@ -42,6 +42,8 @@ def test_no_new_line_issue(data_regression): @pytest.mark.parametrize("line,title,input,expected", read_fixture_file(FIXTURE_PATH)) def test_all(line, title, input, expected): md = MarkdownIt("commonmark").use(container_plugin, "name") + if "DISABLE-CODEBLOCKS" in title: + md.disable("code") md.options["xhtmlOut"] = False text = md.render(input) print(text) diff --git a/tests/test_deflist.py b/tests/test_deflist.py index d924e93..624f167 100644 --- a/tests/test_deflist.py +++ b/tests/test_deflist.py @@ -31,6 +31,8 @@ def test_plugin_parse(data_regression): @pytest.mark.parametrize("line,title,input,expected", read_fixture_file(FIXTURE_PATH)) def test_all(line, title, input, expected): md = MarkdownIt("commonmark").use(deflist_plugin) + if "DISABLE-CODEBLOCKS" in title: + md.disable("code") md.options["xhtmlOut"] = False text = md.render(input) print(text) diff --git a/tests/test_dollarmath.py b/tests/test_dollarmath.py index 6ae0345..a43dc10 100644 --- a/tests/test_dollarmath.py +++ b/tests/test_dollarmath.py @@ -98,6 +98,8 @@ def test_dollarmath_fixtures(line, title, input, expected): double_inline=True, allow_blank_lines=False, ) + if "DISABLE-CODEBLOCKS" in title: + md.disable("code") md.options.xhtmlOut = False text = md.render(input) print(text) diff --git a/tests/test_field_list.py b/tests/test_field_list.py index fa6f49b..03d8146 100644 --- a/tests/test_field_list.py +++ b/tests/test_field_list.py @@ -33,6 +33,8 @@ def test_plugin_parse(data_regression): ) def test_all(line, title, input, expected): md = MarkdownIt("commonmark").use(fieldlist_plugin) + if "DISABLE-CODEBLOCKS" in title: + md.disable("code") md.options["xhtmlOut"] = False text = md.render(input) print(text) diff --git a/tests/test_footnote.py b/tests/test_footnote.py index 076f863..e543c14 100644 --- a/tests/test_footnote.py +++ b/tests/test_footnote.py @@ -451,6 +451,8 @@ def test_plugin_render(): @pytest.mark.parametrize("line,title,input,expected", read_fixture_file(FIXTURE_PATH)) def test_all(line, title, input, expected): md = MarkdownIt("commonmark").use(footnote_plugin) + if "DISABLE-CODEBLOCKS" in title: + md.disable("code") md.options["xhtmlOut"] = False text = md.render(input) print(text) diff --git a/tests/test_myst_block.py b/tests/test_myst_block.py index 632ed4b..fd87cb7 100644 --- a/tests/test_myst_block.py +++ b/tests/test_myst_block.py @@ -13,6 +13,8 @@ @pytest.mark.parametrize("line,title,input,expected", read_fixture_file(FIXTURE_PATH)) def test_all(line, title, input, expected): md = MarkdownIt("commonmark").use(myst_block_plugin) + if "DISABLE-CODEBLOCKS" in title: + md.disable("code") md.options["xhtmlOut"] = False text = md.render(input) print(text) diff --git a/tests/test_texmath.py b/tests/test_texmath.py index efab0e5..42f7d9b 100644 --- a/tests/test_texmath.py +++ b/tests/test_texmath.py @@ -86,6 +86,8 @@ def test_plugin_parse(data_regression): ) def test_dollar_fixtures(line, title, input, expected): md = MarkdownIt("commonmark").use(texmath_plugin) + if "DISABLE-CODEBLOCKS" in title: + md.disable("code") md.options["xhtmlOut"] = False text = md.render(input) print(text) @@ -98,6 +100,8 @@ def test_dollar_fixtures(line, title, input, expected): ) def test_bracket_fixtures(line, title, input, expected): md = MarkdownIt("commonmark").use(texmath_plugin, delimiters="brackets") + if "DISABLE-CODEBLOCKS" in title: + md.disable("code") md.options["xhtmlOut"] = False text = md.render(input) print(text)