aboutsummaryrefslogtreecommitdiff
path: root/modules/base/markdown.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/base/markdown.go')
-rw-r--r--modules/base/markdown.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/base/markdown.go b/modules/base/markdown.go
index a3d3a7ca..0ef379b8 100644
--- a/modules/base/markdown.go
+++ b/modules/base/markdown.go
@@ -142,6 +142,16 @@ func (r *CustomRender) AutoLink(out *bytes.Buffer, link []byte, kind int) {
r.Renderer.AutoLink(out, link, kind)
}
+func (options *CustomRender) ListItem(out *bytes.Buffer, text []byte, flags int) {
+ switch {
+ case bytes.HasPrefix(text, []byte("[ ] ")):
+ text = append([]byte(`<input type="checkbox" disabled="" />`), text[3:]...)
+ case bytes.HasPrefix(text, []byte("[x] ")):
+ text = append([]byte(`<input type="checkbox" disabled="" checked="" />`), text[3:]...)
+ }
+ options.Renderer.ListItem(out, text, flags)
+}
+
var (
svgSuffix = []byte(".svg")
svgSuffixWithMark = []byte(".svg?")