diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index bbdbbc0ba..17fe2c945 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -501,7 +501,7 @@ listItemToHtml opts bls checkbox' = H.input ! A.type_ "checkbox" isContents <- inlineListToHtml opts is bsContents <- blockListToHtml opts bs - return $ constr (checkbox >> isContents) >> + return $ constr (H.label (checkbox >> isContents)) >> (if null bs then mempty else nl) >> bsContents diff --git a/test/command/tasklist.md b/test/command/tasklist.md index caa8603f4..b1c6491cc 100644 --- a/test/command/tasklist.md +++ b/test/command/tasklist.md @@ -6,8 +6,8 @@ tests adapted from - [x] bar ^D ``` @@ -20,12 +20,12 @@ tests adapted from - [ ] bim ^D ``` @@ -53,21 +53,23 @@ paragraph - [x] checked ^D

paragraph

    -
  1. ordered unchecked
  2. +
  3. [] plain item
  4. -
  5. ordered checked
  6. +

paragraph

```