mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-06 00:47:15 -04:00
Guard against empty/malformed markdown list entries
This commit is contained in:
+5
-2
@@ -125,11 +125,14 @@ func (tr *ANSIRenderer) NewElement(node ast.Node, source []byte) Element {
|
|||||||
}
|
}
|
||||||
|
|
||||||
post := "\n"
|
post := "\n"
|
||||||
if node.LastChild().Kind() == ast.KindList || node.NextSibling() == nil {
|
if (node.LastChild() != nil && node.LastChild().Kind() == ast.KindList) ||
|
||||||
|
node.NextSibling() == nil {
|
||||||
post = ""
|
post = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
if node.FirstChild().FirstChild().Kind() == astext.KindTaskCheckBox {
|
if node.FirstChild() != nil &&
|
||||||
|
node.FirstChild().FirstChild() != nil &&
|
||||||
|
node.FirstChild().FirstChild().Kind() == astext.KindTaskCheckBox {
|
||||||
nc := node.FirstChild().FirstChild().(*astext.TaskCheckBox)
|
nc := node.FirstChild().FirstChild().(*astext.TaskCheckBox)
|
||||||
|
|
||||||
return Element{
|
return Element{
|
||||||
|
|||||||
Reference in New Issue
Block a user