Skip to content

Commit 08460b5

Browse files
committed
👌 IMPROVE: Render inline HTML images
1 parent a21b9bb commit 08460b5

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

docs/using/syntax-optional.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ substitutions:
55
```{note}
66
{{ key1 }}
77
```
8-
key3: "![fun fish](img/fun-fish.png)"
8+
key3: <img src="img/fun-fish.png" alt="fishy" width="200px">
99
---
1010

1111
(syntax/optional)=
@@ -99,7 +99,7 @@ substitutions:
9999
```{note}
100100
{{ key1 }}
101101
```
102-
key3: "![fun fish](img/fun-fish.png)"
102+
key3: <img src="img/fun-fish.png" alt="fishy" width="200px">
103103
---
104104
````
105105

@@ -396,6 +396,10 @@ MySt-Parser will attempt to convert any isolated `img` tags (i.e. not wrapped in
396396
Allowed attributes are equivalent to the `image` directive: src, alt, class, width, height and name.
397397
Any other attributes will be dropped.
398398

399+
HTML image can also be used inline!
400+
401+
I'm an inline image: <img src="img/fun-fish.png" height="20px">
402+
399403
(syntax/figures)=
400404

401405
## Markdown Figures

myst_parser/docutils_renderer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ def render_autolink(self, token):
487487
self.current_node.append(ref_node)
488488

489489
def render_html_inline(self, token):
490-
self.current_node.append(nodes.raw("", token.content, format="html"))
490+
self.render_html_block(token)
491491

492492
def render_html_block(self, token):
493493
node = None

0 commit comments

Comments
 (0)