From 2197cd5d18516a53513e2dc142631e5ae6926860 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Tue, 21 Feb 2023 23:00:06 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20colon=5Ffence=20wrapping?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Minor fix to the last commit :sweat_smile: --- myst_parser/mdit_to_docutils/base.py | 4 ++-- tests/test_renderers/fixtures/containers.md | 16 ++++++++-------- .../test_extended_syntaxes.html | 6 +++--- .../test_extended_syntaxes.xml | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/myst_parser/mdit_to_docutils/base.py b/myst_parser/mdit_to_docutils/base.py index 9613706e..2c30fe8e 100644 --- a/myst_parser/mdit_to_docutils/base.py +++ b/myst_parser/mdit_to_docutils/base.py @@ -1498,8 +1498,8 @@ def render_colon_fence(self, token: SyntaxTreeNode) -> None: 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.""" diff --git a/tests/test_renderers/fixtures/containers.md b/tests/test_renderers/fixtures/containers.md index a8bf0e36..2cff3070 100644 --- a/tests/test_renderers/fixtures/containers.md +++ b/tests/test_renderers/fixtures/containers.md @@ -38,10 +38,10 @@ This is **content** . - - This is - - content + + This is + + content . has name: @@ -52,8 +52,8 @@ This is **content** . - - This is - - content + + This is + + 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 7ef7e37c..760f462a 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 @@

+

+ Hallo *there* +

-

- Hallo *there* -

linkify URL: 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 860ce8f0..e8f94330 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 @@ This is a caption in **Markdown** - - Hallo *there* + + Hallo *there* linkify URL: