aboutsummaryrefslogtreecommitdiffstats
path: root/modules/markup
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-03-22 22:25:38 +0000
committerGitHub <noreply@github.com>2020-03-22 22:25:38 +0000
commitf036de5a9470f82be11b24e30548316f2f251602 (patch)
tree70041426d7be573cb8f1f084301c54acbd935b43 /modules/markup
parentc61b902538e8e4b2bb83136f190e044a6bbcdd9b (diff)
downloadgitea-f036de5a9470f82be11b24e30548316f2f251602.tar.gz
gitea-f036de5a9470f82be11b24e30548316f2f251602.zip
Completely fix task-list checkbox styling (#10798)
Continuing on from #10668 this PR makes goldmark apply the task-list styling to task-lists.
Diffstat (limited to 'modules/markup')
-rw-r--r--modules/markup/markdown/goldmark.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/markup/markdown/goldmark.go b/modules/markup/markdown/goldmark.go
index a9475b58c5..5b16fa8e84 100644
--- a/modules/markup/markdown/goldmark.go
+++ b/modules/markup/markdown/goldmark.go
@@ -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
})