From: Daniel Karlsson Date: Fri, 4 Aug 2017 15:08:27 +0000 (+0200) Subject: Render task list item inside label for correct accessibility X-Git-Tag: v0.27~42 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c8257f8b7;p=brevno-suite%2Fhugo Render task list item inside label for correct accessibility Fixes #3303 --- diff --git a/helpers/content_renderer.go b/helpers/content_renderer.go index dee8724a..63be5810 100644 --- a/helpers/content_renderer.go +++ b/helpers/content_renderer.go @@ -50,10 +50,12 @@ func (r *HugoHTMLRenderer) ListItem(out *bytes.Buffer, text []byte, flags int) { switch { case bytes.HasPrefix(text, []byte("[ ] ")): - text = append([]byte(``), text[3:]...) + text = append([]byte(``)...) case bytes.HasPrefix(text, []byte("[x] ")) || bytes.HasPrefix(text, []byte("[X] ")): - text = append([]byte(``), text[3:]...) + text = append([]byte(``)...) } r.Renderer.ListItem(out, text, flags) diff --git a/helpers/content_renderer_test.go b/helpers/content_renderer_test.go index 63e681d9..3bd03854 100644 --- a/helpers/content_renderer_test.go +++ b/helpers/content_renderer_test.go @@ -108,9 +108,9 @@ END `, true, `

TODO:

END

@@ -122,7 +122,7 @@ END {`* [ ] Off END`, true, `

END