Skip to content

Commit

Permalink
👌 IMPROVE: Markdown figure formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Aug 28, 2020
1 parent bf7fd80 commit 64649d9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion myst_parser/docutils_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ def render_container_myst_open(self, token):
self.current_node.append(html_image)
caption = nodes.caption("", "")
with self.current_node_context(caption, append=True):
self.render_paragraph_open(token.children[1])
self.render_children(token.children[1])
return

return self.default_container(token, f"admonition name not recognised: {name}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ <h1>
<img alt="fun-fish" src="_images/fun-fish.png"/>
<p class="caption">
<span class="caption-text">
<p>
This is a caption in **Markdown**
</p>
This is a caption in **Markdown**
</span>
<a class="headerlink" href="#target" title="Permalink to this image">
Expand All @@ -115,9 +113,7 @@ <h1>
</a>
<p class="caption">
<span class="caption-text">
<p>
This is a caption in **Markdown**
</p>
This is a caption in **Markdown**
</span>
<a class="headerlink" href="#other-target" title="Permalink to this image">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@
<figure align="default" classes="other" ids="target" names="target">
<image alt="fun-fish" candidates="{'*': 'fun-fish.png'}" uri="fun-fish.png">
<caption>
<paragraph>
This is a caption in **Markdown**
This is a caption in **Markdown**
<figure align="default" classes="other" ids="other-target" names="other-target">
<image alt="fishy" candidates="{'*': 'fun-fish.png'}" classes="bg-primary mb-1" uri="fun-fish.png" width="200px">
<caption>
<paragraph>
This is a caption in **Markdown**
This is a caption in **Markdown**

0 comments on commit 64649d9

Please sign in to comment.