diff --git a/renderer/blockquote.go b/renderer/blockquote.go index 12100b33..30e8fd0d 100644 --- a/renderer/blockquote.go +++ b/renderer/blockquote.go @@ -118,13 +118,12 @@ func ParseBlockQuoteType(node ast.Node, source []byte) BlockQuoteType { // Classifying the next text type node (midNode) will confirm that. if t == None { midNode := node.NextSibling() - rightNode := midNode.NextSibling() - if midNode.Kind() == ast.KindText { + if midNode != nil && midNode.Kind() == ast.KindText { + rightNode := midNode.NextSibling() midTextNode := midNode.(*ast.Text) if rightNode != nil && rightNode.Kind() == ast.KindText { rightTextNode := rightNode.(*ast.Text) - if string(n.Text(source)) == "[" && string(rightTextNode.Text(source)) == "]" { t = ghAlertsClassifier.ClassifyingBlockQuote(string(midTextNode.Text(source))) } diff --git a/testdata/quotes-droph1.html b/testdata/quotes-droph1.html index 8b98bc47..4fdba685 100644 --- a/testdata/quotes-droph1.html +++ b/testdata/quotes-droph1.html @@ -98,3 +98,7 @@
+[NOTE]
+diff --git a/testdata/quotes-stripnewlines.html b/testdata/quotes-stripnewlines.html index ba9c9731..e07a0474 100644 --- a/testdata/quotes-stripnewlines.html +++ b/testdata/quotes-stripnewlines.html @@ -96,3 +96,6 @@TL;DR: Thingy! +More stuff
+
+[NOTE]
+diff --git a/testdata/quotes.html b/testdata/quotes.html index a2d2a002..15a23176 100644 --- a/testdata/quotes.html +++ b/testdata/quotes.html @@ -99,3 +99,7 @@TL;DR: Thingy! More stuff
+
+[NOTE]
+diff --git a/testdata/quotes.md b/testdata/quotes.md index d9de8e05..aeeb7c1a 100644 --- a/testdata/quotes.md +++ b/testdata/quotes.md @@ -88,3 +88,8 @@ > [Hey !NOTE] > [NOTE] + + + +> **TL;DR:** Thingy! +> More stuffTL;DR: Thingy! +More stuff
+