From 11e4c0d5e62f5a7f3840a83081567eff33f16fd3 Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Wed, 1 Oct 2025 09:51:21 +0200 Subject: feat(markdown): replace line break by space in paragraph --- mardown/ast_paragraph.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mardown/ast_paragraph.go') 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) -- cgit v1.2.3