Skip to content

Commit ca44bc9

Browse files
committed
🧪 Add tests for indenting with code block enabled/disabled
To test that #83 was correctly applied
1 parent 6f1a77e commit ca44bc9

23 files changed

+303
-9
lines changed

‎tests/fixtures/admon.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,3 +292,24 @@ MKdocs Open Collapsible Sections
292292
<p>content</p>
293293
</div>
294294
.
295+
296+
Indented by 4 spaces
297+
.
298+
??? note
299+
content
300+
.
301+
<pre><code>??? note
302+
content
303+
</code></pre>
304+
.
305+
306+
Indented by 4 spaces, DISABLE-CODEBLOCKS
307+
.
308+
??? note
309+
content
310+
.
311+
<div class="admonition note is-collapsible collapsible-closed">
312+
<p class="admonition-title">Note</p>
313+
<p>content</p>
314+
</div>
315+
.

‎tests/fixtures/amsmath.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,29 @@ equation environment, in list:
220220
&amp; x_0 \quad &amp;&amp; \text{valor inicial} \quad &amp;&amp; 0\leq x_0 &lt;m
221221
\end{alignat*}
222222
</div>
223-
.
223+
.
224+
225+
Indented by 4 spaces
226+
.
227+
\begin{equation}
228+
a = 1
229+
\end{equation}
230+
.
231+
<pre><code>\begin{equation}
232+
a = 1
233+
\end{equation}
234+
</code></pre>
235+
.
236+
237+
Indented by 4 spaces, DISABLE-CODEBLOCKS
238+
.
239+
\begin{equation}
240+
a = 1
241+
\end{equation}
242+
.
243+
<div class="math amsmath">
244+
\begin{equation}
245+
a = 1
246+
\end{equation}
247+
</div>
248+
.

‎tests/fixtures/attrs.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
block indented * 4 is not a block
2-
.
3-
{#a .a b=c}
4-
.
5-
<pre><code>{#a .a b=c}
6-
</code></pre>
7-
.
8-
91
block with preceding text is not a block
102
.
113
{#a .a b=c} a
@@ -248,3 +240,21 @@ spans: merge attributes
248240
.
249241
<p><span id="b" class="a b" other="d">a</span></p>
250242
.
243+
244+
Indented by 4 spaces
245+
.
246+
{#a .a b=c}
247+
# head
248+
.
249+
<pre><code>{#a .a b=c}
250+
# head
251+
</code></pre>
252+
.
253+
254+
Indented by 4 spaces, DISABLE-CODEBLOCKS
255+
.
256+
{#a .a b=c}
257+
# head
258+
.
259+
<h1 id="a" b="c" class="a">head</h1>
260+
.

‎tests/fixtures/colon_fence.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,3 +421,26 @@ yyy
421421
yyy
422422
</code></pre>
423423
.
424+
425+
426+
Indented by 4 spaces
427+
.
428+
:::name
429+
foo
430+
:::
431+
.
432+
<pre><code>:::name
433+
foo
434+
:::
435+
</code></pre>
436+
.
437+
438+
Indented by 4 spaces, DISABLE-CODEBLOCKS
439+
.
440+
:::name
441+
foo
442+
:::
443+
.
444+
<pre><code class="block-name" >foo
445+
</code></pre>
446+
.

‎tests/fixtures/container.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,3 +284,27 @@ yyy</p>
284284
<p>yyy
285285
:::</p>
286286
.
287+
288+
289+
Indented by 4 spaces
290+
.
291+
::: name
292+
content
293+
:::
294+
.
295+
<pre><code>::: name
296+
content
297+
:::
298+
</code></pre>
299+
.
300+
301+
Indented by 4 spaces, DISABLE-CODEBLOCKS
302+
.
303+
::: name
304+
content
305+
:::
306+
.
307+
<div class="name">
308+
<p>content</p>
309+
</div>
310+
.

‎tests/fixtures/deflist.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,3 +245,27 @@ test
245245
.
246246
<p>test</p>
247247
.
248+
249+
Indented by 4 spaces
250+
.
251+
Term 1
252+
253+
: Definition 1
254+
.
255+
<pre><code>Term 1
256+
257+
: Definition 1
258+
</code></pre>
259+
.
260+
261+
Indented by 4 spaces, DISABLE-CODEBLOCKS
262+
.
263+
Term 1
264+
265+
: Definition 1
266+
.
267+
<dl>
268+
<dt>Term 1</dt>
269+
<dd>Definition 1</dd>
270+
</dl>
271+
.

‎tests/fixtures/dollar_math.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,3 +562,21 @@ $$1+1=2$$ (a b)
562562
1+1=2
563563
</div>
564564
.
565+
566+
567+
Indented by 4 spaces
568+
.
569+
$$a$$
570+
.
571+
<pre><code>$$a$$
572+
</code></pre>
573+
.
574+
575+
Indented by 4 spaces, DISABLE-CODEBLOCKS
576+
.
577+
$$a$$
578+
.
579+
<div class="math block">
580+
a
581+
</div>
582+
.

‎tests/fixtures/field_list.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,3 +363,28 @@ other</p>
363363
</dl>
364364
</blockquote>
365365
.
366+
367+
368+
Indented by 4 spaces
369+
.
370+
:name: text
371+
indented
372+
.
373+
<pre><code>:name: text
374+
indented
375+
</code></pre>
376+
.
377+
378+
Indented by 4 spaces, DISABLE-CODEBLOCKS
379+
.
380+
:name: text
381+
indented
382+
.
383+
<dl class="field-list">
384+
<dt>name</dt>
385+
<dd>
386+
<p>text
387+
indented</p>
388+
</dd>
389+
</dl>
390+
.

‎tests/fixtures/footnote.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,3 +344,31 @@ b
344344
</ol>
345345
</section>
346346
.
347+
348+
Indented by 4 spaces
349+
.
350+
[^1]
351+
352+
[^1]: footnote
353+
.
354+
<pre><code>[^1]
355+
356+
[^1]: footnote
357+
</code></pre>
358+
.
359+
360+
Indented by 4 spaces, DISABLE-CODEBLOCKS
361+
.
362+
[^1]
363+
364+
[^1]: footnote
365+
.
366+
<p><sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup></p>
367+
<hr class="footnotes-sep">
368+
<section class="footnotes">
369+
<ol class="footnotes-list">
370+
<li id="fn1" class="footnote-item"><p>footnote <a href="#fnref1" class="footnote-backref">↩︎</a></p>
371+
</li>
372+
</ol>
373+
</section>
374+
.

‎tests/fixtures/myst_block.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,32 @@ def --><blockquote>
147147
148148
def -->
149149
.
150+
151+
152+
Indented by 4 spaces
153+
.
154+
+++
155+
156+
% abc
157+
158+
(a)=
159+
.
160+
<pre><code>+++
161+
162+
% abc
163+
164+
(a)=
165+
</code></pre>
166+
.
167+
168+
Indented by 4 spaces, DISABLE-CODEBLOCKS
169+
.
170+
+++
171+
172+
% abc
173+
174+
(a)=
175+
.
176+
<hr class="myst-block">
177+
<!-- abc --><div class="myst-target"><a href="#a">(a)=</a></div>
178+
.

0 commit comments

Comments
 (0)