From 7349948f7f3772d2e7b5bb117004ad6fe3ba4a5c Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sat, 28 Dec 2019 01:50:18 +0100 Subject: [PATCH] Fix blockquote rendering --- ansi/renderer.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ansi/renderer.go b/ansi/renderer.go index c14217c..5f39819 100644 --- a/ansi/renderer.go +++ b/ansi/renderer.go @@ -129,10 +129,14 @@ func (r *ANSIRenderer) renderNode(w util.BufWriter, source []byte, node ast.Node } func isChild(node ast.Node) bool { + if node.Parent() != nil && node.Parent().Kind() == ast.KindBlockquote { + // skip paragraph within blockquote to avoid reflowing text + return true + } for n := node.Parent(); n != nil; n = n.Parent() { // These types are already rendered by their parent switch n.Kind() { - case ast.KindLink, ast.KindImage, ast.KindEmphasis, astext.KindStrikethrough, ast.KindBlockquote, astext.KindTableCell: + case ast.KindLink, ast.KindImage, ast.KindEmphasis, astext.KindStrikethrough, astext.KindTableCell: return true } }