Skip to content

Commit 4cac732

Browse files
authored
🐛 FIX: colon_fence wrapping (#714)
Minor fix to the last commit 😅
1 parent 6b3fc19 commit 4cac732

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

myst_parser/mdit_to_docutils/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,8 +1498,8 @@ def render_colon_fence(self, token: SyntaxTreeNode) -> None:
14981498
if name:
14991499
# note, as per djot, the name is added to the end of the classes
15001500
container["classes"].append(name)
1501-
self.current_node.append(container)
1502-
self.nested_render_text(token.content, token_line(token, 0))
1501+
with self.current_node_context(container, append=True):
1502+
self.nested_render_text(token.content, token_line(token, 0))
15031503

15041504
def render_dl(self, token: SyntaxTreeNode) -> None:
15051505
"""Render a definition list."""

tests/test_renderers/fixtures/containers.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ This is **content**
3838
.
3939
<document source="<src>/index.md">
4040
<container is_div="True">
41-
<paragraph>
42-
This is
43-
<strong>
44-
content
41+
<paragraph>
42+
This is
43+
<strong>
44+
content
4545
.
4646

4747
has name:
@@ -52,8 +52,8 @@ This is **content**
5252
.
5353
<document source="<src>/index.md">
5454
<container classes="name" is_div="True">
55-
<paragraph>
56-
This is
57-
<strong>
58-
content
55+
<paragraph>
56+
This is
57+
<strong>
58+
content
5959
.

tests/test_sphinx/test_sphinx_builds/test_extended_syntaxes.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ <h1>
132132
</figcaption>
133133
</figure>
134134
<div class="other docutils">
135+
<p>
136+
Hallo *there*
137+
</p>
135138
</div>
136-
<p>
137-
Hallo *there*
138-
</p>
139139
<p>
140140
linkify URL:
141141
<a class="reference external" href="http://www.example.com">

tests/test_sphinx/test_sphinx_builds/test_extended_syntaxes.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@
7070
<caption>
7171
This is a caption in **Markdown**
7272
<container classes="other" is_div="True">
73-
<paragraph>
74-
Hallo *there*
73+
<paragraph>
74+
Hallo *there*
7575
<paragraph>
7676
linkify URL:
7777
<reference refuri="http://www.example.com">

0 commit comments

Comments
 (0)