Fix blockquote rendering

This commit is contained in:
Christian Muehlhaeuser
2019-12-28 01:50:18 +01:00
parent 8405e35ac8
commit 7349948f7f
+5 -1
View File
@@ -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
}
}