| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
MathiasSM.Html
Description
Small post-render HTML transforms, applied once a page is fully assembled
Synopsis
- readonlyCheckboxes :: String -> String
Documentation
readonlyCheckboxes :: String -> String Source #
Makes every pandoc task-list checkbox read-only, unless it sits inside an
interactive-classed element.
Pandoc renders `- [ ]` / `- [x]` as `type="checkbox"` inside a `class="task-list"`. On a static page those invite interaction that can't be persisted, so this adds `aria-readonly` and drops each one from the tab order, and the stylesheet stops pointer events on them (and their `label`). A checkbox inside `class="interactive"` is left editable, as is any checkbox outside a task list (e.g. a hand-authored control).