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/lexer.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'markdown/lexer.go') diff --git a/markdown/lexer.go b/markdown/lexer.go index d5c0f5f..30587e4 100644 --- a/markdown/lexer.go +++ b/markdown/lexer.go @@ -1,6 +1,9 @@ package markdown -import "fmt" +import ( + "fmt" + "strings" +) type lexerType string @@ -26,7 +29,7 @@ type lexer struct { } func (l lexer) String() string { - return fmt.Sprintf("%s(%s)", l.Type, l.Value) + return fmt.Sprintf("%s(%s)", l.Type, strings.ReplaceAll(l.Value, "\n", `{\n}`)) } type lexers struct { -- cgit v1.2.3