1
0
Fork 0
forked from forgejo/forgejo

[GITEA] Render status of list items for Org mode

- The library that's being used for org-mode, [doesn't render the status
of list items](https://github.com/niklasfasching/go-org/issues/63).
- Add a modified version of the proposed CSS snippet to still display
the status for the list items. The alternative was parsing HTML and
transforming it, which is too complicated for this small task.
- Resolves https://codeberg.org/Codeberg/Community/issues/1099

(cherry picked from commit 1f59666b6b)
This commit is contained in:
Gusted 2023-07-19 14:30:05 +02:00 committed by Earl Warren
parent a201f2f189
commit 9753c7e4b8
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
3 changed files with 31 additions and 0 deletions

View file

@ -96,6 +96,9 @@ func createDefaultPolicy() *bluemonday.Policy {
// Allow classes for task lists
policy.AllowAttrs("class").Matching(regexp.MustCompile(`task-list-item`)).OnElements("li")
// Allow classes for org mode list item status.
policy.AllowAttrs("class").Matching(regexp.MustCompile(`^(unchecked|checked|indeterminate)$`)).OnElements("li")
// Allow icons
policy.AllowAttrs("class").Matching(regexp.MustCompile(`^icon(\s+[\p{L}\p{N}_-]+)+$`)).OnElements("i")