|
@@ -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?")
|