diff options
| author | Albert Krewinkel <[email protected]> | 2023-03-29 15:18:39 +0200 |
|---|---|---|
| committer | Albert Krewinkel <[email protected]> | 2023-03-29 15:21:04 +0200 |
| commit | b208eb2a560b8571af577667d5df8706f4ba8892 (patch) | |
| tree | c638db068d1f004da11858492f672748a6a51ff5 /src | |
| parent | 930335a45bce3ae7174ea0c35e4ee0041db3735f (diff) | |
HTML writer: wrap task items in labels.
The `<label>` element ensures that the item description is associated
with the checkbox, which is important for accessibility.
See: #8729
Diffstat (limited to 'src')
| -rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index bbdbbc0ba..637e9dc96 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -501,7 +501,8 @@ listItemToHtml opts bls checkbox' = H.input ! A.type_ "checkbox" isContents <- inlineListToHtml opts is bsContents <- blockListToHtml opts bs - return $ constr (checkbox >> isContents) >> + return $ H.label $ + constr (checkbox >> isContents) >> (if null bs then mempty else nl) >> bsContents |
