aboutsummaryrefslogtreecommitdiff
path: root/markdown/ast_paragraph.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2025-12-10 12:20:21 +0100
committerAnhgelus Morhtuuzh <william@herges.fr>2025-12-10 12:20:21 +0100
commit707121c88e2a97d3bfceaba850dcdda79c0f4f37 (patch)
tree55a3b37fa6f57d784a059bd8cacba5cb8e746a58 /markdown/ast_paragraph.go
parent1da34bf7dd198f2cf2a287be4262c61e0e54c275 (diff)
fix(markdown): bad render of external images in rare cases
Diffstat (limited to 'markdown/ast_paragraph.go')
-rw-r--r--markdown/ast_paragraph.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/markdown/ast_paragraph.go b/markdown/ast_paragraph.go
index 361b2f2..197c7e3 100644
--- a/markdown/ast_paragraph.go
+++ b/markdown/ast_paragraph.go
@@ -65,6 +65,10 @@ func paragraph(lxs *lexers, oneLine bool) (*astParagraph, *ParseError) {
}
tree.content = append(tree.content, mod)
case lexerExternal:
+ if n > 0 && lxs.Current().Value == "![" {
+ lxs.Before() // because we did not use it
+ return tree, nil
+ }
n = 0
if lxs.Current().Value == "!" {
tree.content = append(tree.content, astLiteral(lxs.Current().Value))