Skip to content

Commit 400bb7c

Browse files
lunnywxiaoguang
andauthored
Fix bug for markdown rendering of blockquote (#30130)
Caused by #29984 --------- Co-authored-by: wxiaoguang <[email protected]>
1 parent 4640441 commit 400bb7c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

modules/markup/markdown/transform_blockquote.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,16 @@ func (g *ASTTransformer) transformBlockquote(v *ast.Blockquote, reader text.Read
2222
if firstParagraph.ChildCount() < 3 {
2323
return ast.WalkContinue, nil
2424
}
25-
node1, ok1 := firstParagraph.FirstChild().(*ast.Text)
26-
node2, ok2 := node1.NextSibling().(*ast.Text)
27-
node3, ok3 := node2.NextSibling().(*ast.Text)
28-
if !ok1 || !ok2 || !ok3 {
25+
node1, ok := firstParagraph.FirstChild().(*ast.Text)
26+
if !ok {
27+
return ast.WalkContinue, nil
28+
}
29+
node2, ok := node1.NextSibling().(*ast.Text)
30+
if !ok {
31+
return ast.WalkContinue, nil
32+
}
33+
node3, ok := node2.NextSibling().(*ast.Text)
34+
if !ok {
2935
return ast.WalkContinue, nil
3036
}
3137
val1 := string(node1.Segment.Value(reader.Source()))

0 commit comments

Comments
 (0)