Skip to content

Commit f036de5

Browse files
authored
Completely fix task-list checkbox styling (#10798)
Continuing on from #10668 this PR makes goldmark apply the task-list styling to task-lists.
1 parent c61b902 commit f036de5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

modules/markup/markdown/goldmark.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ func (g *GiteaASTTransformer) Transform(node *ast.Document, reader text.Reader,
8282
link = []byte("#user-content-" + string(link)[1:])
8383
}
8484
v.Destination = link
85+
case *ast.List:
86+
if v.HasChildren() && v.FirstChild().HasChildren() && v.FirstChild().FirstChild().HasChildren() {
87+
if _, ok := v.FirstChild().FirstChild().FirstChild().(*east.TaskCheckBox); ok {
88+
v.SetAttributeString("class", "task-list")
89+
}
90+
}
8591
}
8692
return ast.WalkContinue, nil
8793
})

0 commit comments

Comments
 (0)