From 1a2865717e82cbf567ad31622afdfa75f7cbfa1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20Herg=C3=A8s?= Date: Sat, 4 Oct 2025 00:02:29 +0200 Subject: fix(markdown): parsing quote was weird --- markdown/ast_quote.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'markdown/ast_quote.go') diff --git a/markdown/ast_quote.go b/markdown/ast_quote.go index ebd0527..fa3a878 100644 --- a/markdown/ast_quote.go +++ b/markdown/ast_quote.go @@ -44,7 +44,7 @@ func quote(lxs *lexers) (*astQuote, *ParseError) { for lxs.Next() && n < 2 { switch lxs.Current().Type { case lexerBreak: - n += len(lxs.Current().Value) + n = len(lxs.Current().Value) quoteContinue = false case lexerQuote: n = 0 @@ -63,6 +63,7 @@ func quote(lxs *lexers) (*astQuote, *ParseError) { if err != nil { return nil, err } + lxs.Before() // because we must parse the line break if !source { tree.quote = append(tree.quote, p) @@ -77,5 +78,6 @@ func quote(lxs *lexers) (*astQuote, *ParseError) { return tree, nil } } + lxs.Before() // because the code did not use it return tree, nil } -- cgit v1.2.3