Skip to content

feat(model): render checkbox controls as task list tokens - #122

Merged
tomsideguide merged 1 commit into
mainfrom
feat/checkbox-inline
Aug 20, 2026
Merged

feat(model): render checkbox controls as task list tokens#122
tomsideguide merged 1 commit into
mainfrom
feat/checkbox-inline

Conversation

@tomsideguide

@tomsideguide tomsideguide commented Aug 20, 2026

Copy link
Copy Markdown
Member

Checkbox controls had no home in the model: ListItem.checked existed but no reader set it, and readers about to extract form controls (spreadsheets, docx form fields, html inputs) would each have hand-built [x].

Adds Inline::Checkbox(bool), rendered as [x] / [ ] by the Markdown renderer, and folds ListItem.checked into it: a task list item is a list item whose content starts with a checkbox.

Watch: ListItem.checked is removed from the public model.


Summary by cubic

Centralizes checkbox modeling by adding Inline::Checkbox(bool) and removing ListItem.checked. Markdown now renders checkboxes as task-list tokens in content; list rendering no longer injects checkbox state from the item.

  • Model: add Inline::Checkbox and checkbox_text(bool); plain text includes the token; inlines_are_empty treats checkboxes as non-empty.
  • Rendering: Markdown outputs [x]/[ ] and inserts a separating space before following text when needed; task-list appearance comes from an inline checkbox at the start of the first paragraph; table cells render tokens; delimiter logic unchanged.
  • Bindings: Node, Python, and WASM/TypeScript add Inline.kind = 'checkbox' and Inline.checked?: boolean; remove ListItem.checked from all APIs.
  • Other formats: ODF byte sizing counts a checkbox as length 3; ODF and HTML list builders stop setting checked; HTML space-boundary handling treats checkboxes as non-whitespace content.
  • Tests: update task-list cases; add checkbox-in-table coverage.

Bold migrations:

  • Replace all uses of ListItem.checked by inserting Inline::Checkbox(true|false) as the first inline of the item's first paragraph.
  • Readers extracting form controls must emit Inline::Checkbox instead of literal [x]/[ ].
  • Update consumers to read Inline.kind === 'checkbox' and Inline.checked and remove any reads of ListItem.checked.

Written for commit 7847603. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 11 files

Re-trigger cubic

@tomsideguide
tomsideguide merged commit ba05b65 into main Aug 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant