fix(ui): render task-list checkboxes in Markdown descriptions (PMS-347) #177

Merged
longjacksonle merged 1 commit from fix/PMS-309-followup-tasklist-checkboxes into main 2026-06-16 01:22:54 +02:00

Implements PMS-347 (follow-up to PMS-309).

Problem

Markdown renders, but task-list checkboxes (- [ ] / - [x]) showed as plain text. render_markdown enables ENABLE_TASKLISTS, so pulldown-cmark emits <input disabled type="checkbox">, but the default ammonia::clean allowlist drops <input>, leaving only the label.

Fix (src/utils/markdown.rs)

Use an ammonia::Builder that allows a disabled checkbox input: tag input with checked / disabled, plus type restricted to checkbox via add_tag_attribute_values (deliberately kept out of the generic attribute allowlist, which would otherwise allow any type value). Checkboxes render disabled (read-only). All other scrubbing unchanged.

Verification

just pre-commit (pinned rust 1.94 = CI) passes: fmt, clippy -D warnings, wasm check, 93 lib tests (2 new: task-list renders checkboxes; non-checkbox inputs are still stripped).

🤖 Generated with Claude Code

Implements PMS-347 (follow-up to PMS-309). ## Problem Markdown renders, but task-list checkboxes (`- [ ]` / `- [x]`) showed as plain text. `render_markdown` enables `ENABLE_TASKLISTS`, so pulldown-cmark emits `<input disabled type="checkbox">`, but the default `ammonia::clean` allowlist drops `<input>`, leaving only the label. ## Fix (`src/utils/markdown.rs`) Use an `ammonia::Builder` that allows a disabled checkbox input: tag `input` with `checked` / `disabled`, plus `type` restricted to `checkbox` via `add_tag_attribute_values` (deliberately kept out of the generic attribute allowlist, which would otherwise allow any `type` value). Checkboxes render disabled (read-only). All other scrubbing unchanged. ## Verification `just pre-commit` (pinned rust 1.94 = CI) passes: fmt, clippy `-D warnings`, wasm check, 93 lib tests (2 new: task-list renders checkboxes; non-checkbox inputs are still stripped). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(ui): render task-list checkboxes in Markdown descriptions (PMS-347)
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
Check / clippy + fmt + tests (pull_request) Successful in 1m0s
824e44b96f
Follow-up to PMS-309. render_markdown enables ENABLE_TASKLISTS, so pulldown-cmark emits <input disabled type="checkbox"> for `- [ ]` / `- [x]` items, but the default ammonia::clean allowlist drops <input>, leaving the checkbox text bare.

Switch to an ammonia::Builder that allows a disabled checkbox input: tag `input` with `checked` / `disabled`, plus `type` restricted to `checkbox` via add_tag_attribute_values (kept out of the generic attribute allowlist, which would otherwise permit any value). Checkboxes stay disabled (read-only). Tests cover task-list rendering and that no other input type passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
longjacksonle deleted branch fix/PMS-309-followup-tasklist-checkboxes 2026-06-16 01:22:54 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!177
No description provided.