Skip to content

Commit

Permalink
Completely fix task-list checkbox styling (#10798)
Browse files Browse the repository at this point in the history
Continuing on from #10668 this PR makes goldmark apply the task-list styling to task-lists.
  • Loading branch information
zeripath authored Mar 22, 2020
1 parent c61b902 commit f036de5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/markup/markdown/goldmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ func (g *GiteaASTTransformer) Transform(node *ast.Document, reader text.Reader,
link = []byte("#user-content-" + string(link)[1:])
}
v.Destination = link
case *ast.List:
if v.HasChildren() && v.FirstChild().HasChildren() && v.FirstChild().FirstChild().HasChildren() {
if _, ok := v.FirstChild().FirstChild().FirstChild().(*east.TaskCheckBox); ok {
v.SetAttributeString("class", "task-list")
}
}
}
return ast.WalkContinue, nil
})
Expand Down

0 comments on commit f036de5

Please sign in to comment.