mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-08-28 04:46:29 -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"
|
||||
if node.LastChild().Kind() == ast.KindList || node.NextSibling() == nil {
|
||||
if (node.LastChild() != nil && node.LastChild().Kind() == ast.KindList) ||
|
||||
node.NextSibling() == nil {
|
||||
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)
|
||||
|
||||
return Element{
|
||||
|
||||
Reference in New Issue
Block a user