diff options
Diffstat (limited to 'mardown/ast_paragraph.go')
| -rw-r--r-- | mardown/ast_paragraph.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/mardown/ast_paragraph.go b/mardown/ast_paragraph.go index e9855a7..d728183 100644 --- a/mardown/ast_paragraph.go +++ b/mardown/ast_paragraph.go @@ -43,7 +43,13 @@ func paragraph(lxs *lexers, oneLine bool) (*astParagraph, error) { switch lxs.Current().Type { case lexerBreak: n++ - case lexerLiteral, lexerHeader, lexerQuote: + case lexerQuote: + if n > 0 { + lxs.Before() + return tree, nil + } + tree.content = append(tree.content, astLiteral(lxs.Current().Value)) + case lexerLiteral, lexerHeader: n = 0 tree.content = append(tree.content, astLiteral(lxs.Current().Value)) case lexerModifier: @@ -68,6 +74,9 @@ func paragraph(lxs *lexers, oneLine bool) (*astParagraph, error) { return tree, nil } } + if !lxs.Finished() { + lxs.Before() // because we never handle the last item + } return tree, nil } |
