Repository: executablebooks/MyST-Parser
Pull request #714 (2023-02-21 22:00:21)

🐛 FIX: colon_fence wrapping
Minor fix to the last commit :sweat_smile:

codecov[bot]: # [Codecov](https://codecov.io/gh/executablebooks/MyST-Parser/pull/714?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks) Report
Base: **89.36**% // Head: **89.36**% // No change to project coverage :thumbsup:
> Coverage data is based on head [(`2197cd5`)](https://codecov.io/gh/executablebooks/MyST-Parser/pull/714?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks) compared to base [(`6b3fc19`)](https://codecov.io/gh/executablebooks/MyST-Parser/commit/6b3fc19e8f2d39060de7b33351be4be4dffb131e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks).
> Patch coverage: 100.00% of modified lines in pull request are covered.

<details><summary>Additional details and impacted files</summary>


```diff
@@           Coverage Diff           @@
##           master     #714   +/-   ##
=======================================
  Coverage   89.36%   89.36%           
=======================================
  Files          23       23           
  Lines        2867     2867           
=======================================
  Hits         2562     2562           
  Misses        305      305           
```

| Flag | Coverage Δ | |
|---|---|---|
| pytests | `89.36% <100.00%> (ø)` | |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Impacted Files](https://codecov.io/gh/executablebooks/MyST-Parser/pull/714?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks) | Coverage Δ | |
|---|---|---|
| [myst\_parser/mdit\_to\_docutils/base.py](https://codecov.io/gh/executablebooks/MyST-Parser/pull/714?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks#diff-bXlzdF9wYXJzZXIvbWRpdF90b19kb2N1dGlscy9iYXNlLnB5) | `92.88% <100.00%> (ø)` | |

Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks)

</details>

[:umbrella: View full report at Codecov](https://codecov.io/gh/executablebooks/MyST-Parser/pull/714?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks).   
:loudspeaker: Do you have feedback about the report comment? [Let us know in this issue](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks).


Patch:
diff --git a/myst_parser/mdit_to_docutils/base.py b/myst_parser/mdit_to_docutils/base.py
index 9613706..2c30fe8 100644
--- a/myst_parser/mdit_to_docutils/base.py
+++ b/myst_parser/mdit_to_docutils/base.py
@@ -1498,8 +1498,8 @@ class DocutilsRenderer(RendererProtocol):
         if name:
             # note, as per djot, the name is added to the end of the classes
             container["classes"].append(name)
-        self.current_node.append(container)
-        self.nested_render_text(token.content, token_line(token, 0))
+        with self.current_node_context(container, append=True):
+            self.nested_render_text(token.content, token_line(token, 0))
 
     def render_dl(self, token: SyntaxTreeNode) -> None:
         """Render a definition list."""


Test patch:
diff --git a/tests/test_renderers/fixtures/containers.md b/tests/test_renderers/fixtures/containers.md
index a8bf0e3..2cff307 100644
--- a/tests/test_renderers/fixtures/containers.md
+++ b/tests/test_renderers/fixtures/containers.md
@@ -38,10 +38,10 @@ This is **content**
 .
 <document source="<src>/index.md">
     <container is_div="True">
-    <paragraph>
-        This is
-        <strong>
-            content
+        <paragraph>
+            This is
+            <strong>
+                content
 .
 
 has name:
@@ -52,8 +52,8 @@ This is **content**
 .
 <document source="<src>/index.md">
     <container classes="name" is_div="True">
-    <paragraph>
-        This is
-        <strong>
-            content
+        <paragraph>
+            This is
+            <strong>
+                content
 .
diff --git a/tests/test_sphinx/test_sphinx_builds/test_extended_syntaxes.html b/tests/test_sphinx/test_sphinx_builds/test_extended_syntaxes.html
index 7ef7e37..760f462 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_extended_syntaxes.html
+++ b/tests/test_sphinx/test_sphinx_builds/test_extended_syntaxes.html
@@ -132,10 +132,10 @@ b=2
      </figcaption>
     </figure>
     <div class="other docutils">
+     <p>
+      Hallo *there*
+     </p>
     </div>
-    <p>
-     Hallo *there*
-    </p>
     <p>
      linkify URL:
      <a class="reference external" href="http://www.example.com">
diff --git a/tests/test_sphinx/test_sphinx_builds/test_extended_syntaxes.xml b/tests/test_sphinx/test_sphinx_builds/test_extended_syntaxes.xml
index 860ce8f..e8f9433 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_extended_syntaxes.xml
+++ b/tests/test_sphinx/test_sphinx_builds/test_extended_syntaxes.xml
@@ -70,8 +70,8 @@
             <caption>
                 This is a caption in **Markdown**
         <container classes="other" is_div="True">
-        <paragraph>
-            Hallo *there*
+            <paragraph>
+                Hallo *there*
         <paragraph>
             linkify URL: 
             <reference refuri="http://www.example.com">