Skip to content

Commit b8551f8

Browse files
cipherboyzeripath
andauthored
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 <alexander.m.scheel@gmail.com> * Update to goldmark v1.1.25 This version adds the missing space after a checkbox. Resolves: #9656 Signed-off-by: Alexander Scheel <alexander.m.scheel@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
1 parent 33c5e5e commit b8551f8

File tree

7 files changed

+28
-18
lines changed

7 files changed

+28
-18
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ require (
9696
github.com/unknwon/paginater v0.0.0-20151104151617-7748a72e0141
9797
github.com/urfave/cli v1.20.0
9898
github.com/yohcop/openid-go v0.0.0-20160914080427-2c050d2dae53
99-
github.com/yuin/goldmark v1.1.24
99+
github.com/yuin/goldmark v1.1.25
100100
go.etcd.io/bbolt v1.3.3 // indirect
101101
golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d
102102
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa

go.sum

+1
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ github.com/yohcop/openid-go v0.0.0-20160914080427-2c050d2dae53 h1:HsIQ6yAjfjQ3Ix
576576
github.com/yohcop/openid-go v0.0.0-20160914080427-2c050d2dae53/go.mod h1:f6elajwZV+xceiaqgRL090YzLEDGSbqr3poGL3ZgXYo=
577577
github.com/yuin/goldmark v1.1.24 h1:K4FemPDr4x/ZcqldoXWnexTLfdMIy2eEfXxsLnotTRI=
578578
github.com/yuin/goldmark v1.1.24/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
579+
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
579580
github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs=
580581
github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0=
581582
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=

modules/markup/sanitizer.go

+3
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ func ReplaceSanitizer() {
5353
// Allow classes for anchors
5454
sanitizer.policy.AllowAttrs("class").Matching(regexp.MustCompile(`ref-issue`)).OnElements("a")
5555

56+
// Allow classes for task lists
57+
sanitizer.policy.AllowAttrs("class").Matching(regexp.MustCompile(`task-list`)).OnElements("ul")
58+
5659
// Allow generally safe attributes
5760
generalSafeAttrs := []string{"abbr", "accept", "accept-charset",
5861
"accesskey", "action", "align", "alt",

vendor/github.com/yuin/goldmark/extension/tasklist.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/yuin/goldmark/parser/list.go

+15-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ github.com/willf/bitset
452452
github.com/xanzy/ssh-agent
453453
# github.com/yohcop/openid-go v0.0.0-20160914080427-2c050d2dae53
454454
github.com/yohcop/openid-go
455-
# github.com/yuin/goldmark v1.1.24
455+
# github.com/yuin/goldmark v1.1.25
456456
github.com/yuin/goldmark
457457
github.com/yuin/goldmark/ast
458458
github.com/yuin/goldmark/extension

web_src/less/_markdown.less

+5
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@
192192
list-style-type: none;
193193
}
194194

195+
ul.task-list,
196+
ol.task-list {
197+
list-style-type: none;
198+
}
199+
195200
ul ul,
196201
ul ol,
197202
ol ol,

0 commit comments

Comments
 (0)