From c8257f8b726478ca70dc8984cdcc17b31e4bdc0c Mon Sep 17 00:00:00 2001 From: Daniel Karlsson Date: Fri, 4 Aug 2017 17:08:27 +0200 Subject: [PATCH] Render task list item inside label for correct accessibility Fixes #3303 --- helpers/content_renderer.go | 6 ++++-- helpers/content_renderer_test.go | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) 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

-- 2.30.2