aboutsummaryrefslogtreecommitdiff
path: root/markdown/lexer.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/lexer.go
parent1da34bf7dd198f2cf2a287be4262c61e0e54c275 (diff)
fix(markdown): bad render of external images in rare cases
Diffstat (limited to 'markdown/lexer.go')
-rw-r--r--markdown/lexer.go7
1 files changed, 5 insertions, 2 deletions
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 {