Skip to content

Commit a178448

Browse files
🐛 FIX: Newline not rendered in image alt attribute (#157)
This is a sibling of the upstream commit: markdown-it/markdown-it@272a470 Co-authored-by: Chris Sewell <chrisj_sewell@hotmail.com>
1 parent 7d44103 commit a178448

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

markdown_it/port.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
- package: markdown-it/markdown-it
2-
version: 12.0.5
3-
commit: 3740146fc9c92ea15fdc6a358137ec7b68f05f4b
4-
date: Apr 14, 2021
2+
version: 12.0.6
3+
commit: df4607f1d4d4be7fdc32e71c04109aea8cc373fa
4+
date: Apr 16, 2021
55
notes:
66
- Rename variables that use python built-in names, e.g.
77
- `max` -> `maximum`

markdown_it/renderer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ def renderInlineAsText(
192192
elif token.type == "image":
193193
assert token.children is not None
194194
result += self.renderInlineAsText(token.children, options, env)
195+
elif token.type == "softbreak":
196+
result += "\n"
195197

196198
return result
197199

tests/test_port/fixtures/commonmark_extras.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,15 @@ baz</p>
630630
</blockquote>
631631
.
632632

633+
Newline in image description
634+
.
635+
There is a newline in this image ![here
636+
it is](https://github.com/executablebooks/)
637+
.
638+
<p>There is a newline in this image <img src="https://github.com/executablebooks/" alt="here
639+
it is" /></p>
640+
.
641+
633642
Issue #772. Header rule should not interfere with html tags.
634643
.
635644
<!--

0 commit comments

Comments
 (0)