forked from forgejo/forgejo
Render plaintext task list items for markdown files (#26186)
- 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 9753c7e4b8
)
Refs: https://codeberg.org/forgejo/forgejo/pulls/1071
Co-authored-by: Gusted <postmaster@gusted.xyz>
This commit is contained in:
parent
16afe4f631
commit
eaea530d6b
3 changed files with 31 additions and 0 deletions
|
@ -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")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue