ソースを参照

Fix bug for markdown rendering of blockquote (#30130)

Caused by #29984

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
tags/v1.22.0-rc0
Lunny Xiao 2ヶ月前
コミット
400bb7ced4
コミッターのメールアドレスに関連付けられたアカウントが存在しません
1個のファイルの変更10行の追加4行の削除
  1. 10
    4
      modules/markup/markdown/transform_blockquote.go

+ 10
- 4
modules/markup/markdown/transform_blockquote.go ファイルの表示

@@ -22,10 +22,16 @@ func (g *ASTTransformer) transformBlockquote(v *ast.Blockquote, reader text.Read
if firstParagraph.ChildCount() < 3 {
return ast.WalkContinue, nil
}
node1, ok1 := firstParagraph.FirstChild().(*ast.Text)
node2, ok2 := node1.NextSibling().(*ast.Text)
node3, ok3 := node2.NextSibling().(*ast.Text)
if !ok1 || !ok2 || !ok3 {
node1, ok := firstParagraph.FirstChild().(*ast.Text)
if !ok {
return ast.WalkContinue, nil
}
node2, ok := node1.NextSibling().(*ast.Text)
if !ok {
return ast.WalkContinue, nil
}
node3, ok := node2.NextSibling().(*ast.Text)
if !ok {
return ast.WalkContinue, nil
}
val1 := string(node1.Segment.Value(reader.Source()))

読み込み中…
キャンセル
保存