Title: id(web/editor): task_list parseDOM reads el.start unvalidated — the #2005 ordered_list fix does not cover ordered task lists; fractional/negative starts save as bullet lists, hex/scientific starts are reinterpreted · Issue #4100 · developing-today/code · GitHub
Open Graph Title: id(web/editor): task_list parseDOM reads el.start unvalidated — the #2005 ordered_list fix does not cover ordered task lists; fractional/negative starts save as bullet lists, hex/scientific starts are reinterpreted · Issue #4100 · developing-today/code
X Title: id(web/editor): task_list parseDOM reads el.start unvalidated — the #2005 ordered_list fix does not cover ordered task lists; fractional/negative starts save as bullet lists, hex/scientific starts are reinterpreted · Issue #4100 · developing-today/code
Description: Problem In the id web editor, the task_list node's parseDOM rule for reads the list start from the DOM's own el.start reflection instead of the validated parseOrderedListStart helper that #2005 / PR #4078 added for the sibling order...
Open Graph Description: Problem In the id web editor, the task_list node's parseDOM rule for reads the list start from the DOM's own el.start reflection instead of the validated parseOrderedListStart helper that #200...
X Description: Problem In the id web editor, the task_list node's parseDOM rule for <ol> reads the list start from the DOM's own el.start reflection instead of the validated parseOrderedListStart he...
Opengraph URL: https://github.com/developing-today/code/issues/4100
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"id(web/editor): task_list parseDOM reads el.start unvalidated — the #2005 ordered_list fix does not cover ordered task lists; fractional/negative starts save as bullet lists, hex/scientific starts are reinterpreted","articleBody":"## Problem\n\nIn the `id` web editor, the `task_list` node's `parseDOM` rule for `\u003col>` reads the list start from the DOM's own `el.start` reflection instead of the validated `parseOrderedListStart` helper that #2005 / PR #4078 added for the sibling `ordered_list` rule in the same file — so ordered **task** lists still admit every start value that fix was created to reject:\n\n- `pkgs/id/web/src/editor.ts:210-218` — both branches of the task_list `\u003col>` rule return `{ order: el.start }`. `el.start` is whatever the DOM implementation makes of the raw attribute; nothing checks it is a plain non-negative decimal integer.\n- `pkgs/id/web/src/editor.ts:46-57,118` — `parseOrderedListStart` (plain `\\d+`, safe-integer, fallback 1) is applied only to `ordered_list`. The `task_list` attrs (`editor.ts:203`) declare `order: { default: null }` with no validation.\n- `pkgs/id/src/web/markdown.rs:4378` — on save, the codec reads task_list `attrs.order` via `as_u64()`: a negative or fractional order reads as `None`, and the list is rebuilt as a **bullet** task list (markdown.rs:4379-4390). A pasted ordered task list silently loses its ordering on save.\n- `pkgs/id/web/src/editor.ts:220-227` — the task_list `toDOM` emits `start=\"\u003corder>\"` for any order ≠ 1, so a stored `-3` or `2.5` round-trips into the rendered HTML verbatim until the save drops the ordering entirely.\n\n## Verified this run (2026-11-01, main `ceba688a`; laptop clone at `7a0da2fc`, `editor.ts` md5 `82283862fb30369b0bc9864a49c2568d` identical on both)\n\nProbe on the laptop (`~/git/fleet/probe-2026-11-01-laneA-tasklist-start/`, happy-dom — the DOM implementation of the repo's own test suite, `pkgs/id/web/vitest.config.ts` — reading `el.start` exactly as editor.ts:214/216 does, against `parseOrderedListStart`, the helper copied verbatim):\n\n| start attr | task_list `el.start` → saves as | ordered_list `parseOrderedListStart` |\n|---|---|---|\n| (absent) | 1 → ordered from 1 | 1 |\n| `5` / `0` / `42` | 5 / 0 / 42 → preserved | 5 / 0 / 42 |\n| `2.5` | 2.5 → **bullet** (as_u64 None) | 1 |\n| `-3` | -3 → **bullet** (as_u64 None) | 1 |\n| `\"\"` | 0 → ordered from 0 | 1 |\n| `0x10` | 16 → **saved as 16** (reinterpreted) | 1 |\n| `1e3` | 1000 → **saved as 1000** (reinterpreted) | 1 |\n| `9007199254740993` | 9007199254740992 → saved rounded | 1 |\n\nIn a spec-compliant browser `el.start` is the IDL signed-long reflection, whose details differ (it truncates `2.5` to 2, parses `0x10` as 0, clamps huge values to 2147483647) — but it still bypasses the fallback-to-1 rule, still truncates instead of rejecting, and still admits negatives that the u64 codec cannot represent. Neither reflection is the validated read #2005 established.\n\n## Why it matters\n\nThis is the residual half of #2005 in the same schema: the plain ordered list was hardened, the ordered task list — which shares the `\u003col start>` surface and the same u64 save codec — was not. Pasted web content is the realistic source (task lists copied from rendered HTML carry whatever `start` the source page had), and the failure shapes are the two #2005/#2010 classics: silent reinterpretation (`0x10` → 16) and silent loss on save (negative/fractional → bullet list). Distinct from #2010 (image width/height `Number()` in the same file) — different node, different expression, different downstream failure.\n\n## Acceptance criteria\n\n- [ ] The task_list `\u003col>` parseDOM rule derives `order` from `parseOrderedListStart(el.getAttribute(\"start\"))` (or an equivalent validated read): only a plain non-negative decimal integer within safe range is preserved (0 included); malformed, fractional, negative, hex/scientific, empty, or unsafe values fall back to 1, exactly as `ordered_list` — in both branches (class-matched and checkbox-detected).\n- [ ] Tests mirroring the #2005 `ordered_list start parsing` block cover the task_list rule's getAttrs for the same value set (`5`, `0`, `42` preserved; `abc`, `2.5`, `0x10`, `1e3`, empty, `-3`, `9007199254740993` → 1; absent → 1).\n- [ ] The editor test suite passes (`bun run test` in `pkgs/id/web` or CI equivalent).\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-11-02T00:53:45Z","url":"https://github.com/developing-today/code/issues/4100"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:35c80e20-decc-7d6c-7f6e-7774dd7db765 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B250:1139E2:106D5EF:15FD4A2:6B0656A1 |
| html-safe-nonce | e9237f5c06288c09c9751ffa4f20050ef0c901ca82bd58b114c9312089c554ab |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjUwOjExMzlFMjoxMDZENUVGOjE1RkQ0QTI6NkIwNjU2QTEiLCJ2aXNpdG9yX2lkIjoiNzk0NTMxNjM1MjYzNjkwMTAyNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a61105d0474f14f58f6430f27c6060efee71fcf486a3b4c8b5d11a28a2b72789 |
| hovercard-subject-tag | issue:6154176524 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/4100/issue_layout |
| twitter:image | https://opengraph.githubassets.com/687e2b05af887e3bdc95678ea7a45ff092ea63a2f24baf282285c7c2dbba1c8d/developing-today/code/issues/4100 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/687e2b05af887e3bdc95678ea7a45ff092ea63a2f24baf282285c7c2dbba1c8d/developing-today/code/issues/4100 |
| og:image:alt | Problem In the id web editor, the task_list node's parseDOM rule for
|
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6324e6ac990fb6befbec840cc0e102a1071c339bfe8f9826bb12de2e3ba1d297 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7f0aa75f4141d440c6110dc31af7ea7797abb6c4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width