Markdown checklist items (- [ ] / - [x]) were rendered as plain bullet points instead of checkboxes when updating a page.
The client-side markdown → ProseMirror conversion (marked → generateJSON) dropped the checkbox, so task lists degraded to a bulletList.
Root cause
The conversion pipeline is marked.parse() → HTML → generateJSON(html, tiptapExtensions). Two combined issues:
tiptapExtensions did not register TaskList / TaskItem.
marked emits <ul><li><input type="checkbox"> text</li></ul>, but TipTap's parseHTML rules only match ul[data-type="taskList"] and li[data-type="taskItem"] (with the checked state in data-checked). The <input> was therefore discarded.
create_page uses the server-side /pages/import endpoint (Docmost parses the markdown itself), so it was unaffected.
Changes
File
Change
src/lib/tiptap-extensions.ts
Register TaskList and TaskItem (with nested: true) extensions
src/lib/markdown-to-json.ts
Add normalizeTaskLists() to rewrite marked's checkbox markup into the data-type/data-checked format TipTap expects before generateJSON
src/lib/collaboration.ts
Reuse markdownToTiptapJson() instead of duplicating the marked + generateJSON logic (DRY) so update_page and comments share one conversion path
Plain bullets (- item) still produce bulletList; numbered lists still produce orderedList (no regression)
End-to-end: restart the MCP server, run update_page with - [ ] / - [x] content, confirm checkboxes render in the Docmost UI
## Summary
- Markdown checklist items (`- [ ]` / `- [x]`) were rendered as plain bullet points instead of checkboxes when updating a page.
- The client-side markdown → ProseMirror conversion (`marked` → `generateJSON`) dropped the checkbox, so task lists degraded to a `bulletList`.
## Root cause
The conversion pipeline is `marked.parse()` → HTML → `generateJSON(html, tiptapExtensions)`. Two combined issues:
1. `tiptapExtensions` did not register `TaskList` / `TaskItem`.
2. `marked` emits `<ul><li><input type="checkbox"> text</li></ul>`, but TipTap's `parseHTML` rules only match `ul[data-type="taskList"]` and `li[data-type="taskItem"]` (with the checked state in `data-checked`). The `<input>` was therefore discarded.
`create_page` uses the server-side `/pages/import` endpoint (Docmost parses the markdown itself), so it was unaffected.
## Changes
| File | Change |
|------|--------|
| `src/lib/tiptap-extensions.ts` | Register `TaskList` and `TaskItem` (with `nested: true`) extensions |
| `src/lib/markdown-to-json.ts` | Add `normalizeTaskLists()` to rewrite marked's checkbox markup into the `data-type`/`data-checked` format TipTap expects before `generateJSON` |
| `src/lib/collaboration.ts` | Reuse `markdownToTiptapJson()` instead of duplicating the `marked` + `generateJSON` logic (DRY) so `update_page` and comments share one conversion path |
## Test Plan
- [x] `npm run build` passes (tsc, no errors)
- [x] `markdownToTiptapJson("- [ ] uno\n- [x] dos")` produces `taskList` › `taskItem` nodes with `checked: false` / `checked: true`
- [x] Plain bullets (`- item`) still produce `bulletList`; numbered lists still produce `orderedList` (no regression)
- [x] End-to-end: restart the MCP server, run `update_page` with `- [ ]` / `- [x]` content, confirm checkboxes render in the Docmost UI
Markdown checklist items (`- [ ]` / `- [x]`) were rendered as plain
bullet points instead of checkboxes. The client-side conversion pipeline
(marked -> generateJSON) dropped the checkbox because:
- tiptapExtensions did not register TaskList/TaskItem.
- marked emits `<ul><li><input type="checkbox">`, but TipTap's parseHTML
rules only match `ul[data-type="taskList"]` / `li[data-type="taskItem"]`
with the checked state in `data-checked`.
Register TaskList/TaskItem and add normalizeTaskLists() to rewrite marked's
checkbox markup into the format TipTap expects before generateJSON runs.
collaboration.ts now reuses markdownToTiptapJson() so update_page and
comments share the same conversion.
aleleba
merged commit e28c6abcad into main2026-06-11 00:02:09 -06:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
- [ ]/- [x]) were rendered as plain bullet points instead of checkboxes when updating a page.marked→generateJSON) dropped the checkbox, so task lists degraded to abulletList.Root cause
The conversion pipeline is
marked.parse()→ HTML →generateJSON(html, tiptapExtensions). Two combined issues:tiptapExtensionsdid not registerTaskList/TaskItem.markedemits<ul><li><input type="checkbox"> text</li></ul>, but TipTap'sparseHTMLrules only matchul[data-type="taskList"]andli[data-type="taskItem"](with the checked state indata-checked). The<input>was therefore discarded.create_pageuses the server-side/pages/importendpoint (Docmost parses the markdown itself), so it was unaffected.Changes
src/lib/tiptap-extensions.tsTaskListandTaskItem(withnested: true) extensionssrc/lib/markdown-to-json.tsnormalizeTaskLists()to rewrite marked's checkbox markup into thedata-type/data-checkedformat TipTap expects beforegenerateJSONsrc/lib/collaboration.tsmarkdownToTiptapJson()instead of duplicating themarked+generateJSONlogic (DRY) soupdate_pageand comments share one conversion pathTest Plan
npm run buildpasses (tsc, no errors)markdownToTiptapJson("- [ ] uno\n- [x] dos")producestaskList›taskItemnodes withchecked: false/checked: true- item) still producebulletList; numbered lists still produceorderedList(no regression)update_pagewith- [ ]/- [x]content, confirm checkboxes render in the Docmost UI