aboutsummaryrefslogtreecommitdiff
path: root/mardown/ast_paragraph.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2025-10-01 09:51:21 +0200
committerAnhgelus Morhtuuzh <william@herges.fr>2025-10-01 09:51:21 +0200
commit11e4c0d5e62f5a7f3840a83081567eff33f16fd3 (patch)
tree59a070566b4912a2e01c37566b8723ef58c4871a /mardown/ast_paragraph.go
parente189a051ef8fe5e9fb439773e4cbc27103f537ca (diff)
feat(markdown): replace line break by space in paragraph
Diffstat (limited to 'mardown/ast_paragraph.go')
-rw-r--r--mardown/ast_paragraph.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/mardown/ast_paragraph.go b/mardown/ast_paragraph.go
index 687e735..5961370 100644
--- a/mardown/ast_paragraph.go
+++ b/mardown/ast_paragraph.go
@@ -50,8 +50,13 @@ func paragraph(lxs *lexers, oneLine bool) (*astParagraph, error) {
}
tree.content = append(tree.content, astLiteral(lxs.Current().Value))
case lexerLiteral, lexerHeader:
+ s := lxs.Current().Value
+ // replace line break by space
+ if n > 0 {
+ s = " " + s
+ }
n = 0
- tree.content = append(tree.content, astLiteral(lxs.Current().Value))
+ tree.content = append(tree.content, astLiteral(s))
case lexerModifier:
n = 0
mod, err := modifier(lxs)