From b8551f8532ef7b98cdd8522440b3ff20f39b49f5 Mon Sep 17 00:00:00 2001 From: Alexander Scheel Date: Sun, 8 Mar 2020 15:17:03 -0400 Subject: Fix task-list checkbox styling (#10668) * Fix task-list checkbox styling The pandoc renderer will append the class "task-list" to the ul element wrapping a li with one or more check-boxes. This allows us to select for them, removing their list-style-type property. However, goldmark and the gfm spec doesn't specify the "task-list" class name, so we can't use that to fix the issue there. Signed-off-by: Alexander Scheel * Update to goldmark v1.1.25 This version adds the missing space after a checkbox. Resolves: #9656 Signed-off-by: Alexander Scheel Co-authored-by: zeripath --- modules/markup/sanitizer.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules/markup/sanitizer.go') diff --git a/modules/markup/sanitizer.go b/modules/markup/sanitizer.go index ee9944723e..b5c6dc25f4 100644 --- a/modules/markup/sanitizer.go +++ b/modules/markup/sanitizer.go @@ -53,6 +53,9 @@ func ReplaceSanitizer() { // Allow classes for anchors sanitizer.policy.AllowAttrs("class").Matching(regexp.MustCompile(`ref-issue`)).OnElements("a") + // Allow classes for task lists + sanitizer.policy.AllowAttrs("class").Matching(regexp.MustCompile(`task-list`)).OnElements("ul") + // Allow generally safe attributes generalSafeAttrs := []string{"abbr", "accept", "accept-charset", "accesskey", "action", "align", "alt", -- cgit v1.2.3