Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion markdown_it/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ def renderInlineAsText(
elif token.type == "image":
if token.children:
result += self.renderInlineAsText(token.children, options, env)
elif token.type == "softbreak":
elif token.type in ("html_inline", "html_block"):
result += token.content
elif token.type in ("softbreak", "hardbreak"):
result += "\n"

return result
Expand Down
16 changes: 16 additions & 0 deletions tests/test_port/fixtures/commonmark_extras.md
Original file line number Diff line number Diff line change
Expand Up @@ -749,3 +749,19 @@ Issue #204. Combination of blockquotes, list and newlines causes an IndexError
</li>
</ul>
.

Hardbreak in image description
.
![foo\
bar](/url)
.
<p><img src="/url" alt="foo
bar" /></p>
.

Inline HTML in image description
.
![a<b>c](/url)
.
<p><img src="/url" alt="a&lt;b&gt;c" /></p>
.