From 707121c88e2a97d3bfceaba850dcdda79c0f4f37 Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Wed, 10 Dec 2025 12:20:21 +0100 Subject: fix(markdown): bad render of external images in rare cases --- markdown/ast_paragraph.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'markdown/ast_paragraph.go') 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)) -- cgit v1.2.3