{"record":{"id":"29eafa8a1a46bb26","repo":"zed-industries/zed","slug":"pending-checkbox-text-must-have-source-mappings","errorCode":null,"errorMessage":"pending checkbox text must have source mappings","messagePattern":"pending checkbox text must have source mappings","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/markdown/src/markdown.rs","lineNumber":4004,"sourceCode":"    fn pop_code_block(&mut self) {\n        self.code_block_stack.pop();\n    }\n\n    fn push_link(&mut self, destination_url: SharedString, source_range: Range<usize>) {\n        self.rendered_links.push(RenderedLink {\n            source_range,\n            destination_url,\n        });\n    }\n\n    fn push_image_link(\n        &mut self,\n        destination_url: SharedString,\n        bounds: Rc<Cell<Option<Bounds<Pixels>>>>,\n    ) {\n        self.rendered_image_links.push(RenderedImageLink {\n            bounds,\n            destination_url,\n        });\n    }\n\n    fn push_footnote_ref(&mut self, label: SharedString, source_range: Range<usize>) {\n        self.rendered_footnote_refs.push(RenderedFootnoteRef {\n            source_range,\n            label,\n        });\n    }\n\n    fn push_text(&mut self, text: &str, source_range: Range<usize>) {\n        self.pending_line.source_mappings.push(SourceMapping {\n            rendered_index: self.pending_line.text.len(),\n            source_index: source_range.start,\n        });\n        self.pending_line.text.push_str(text);\n        self.current_source_index = source_range.end;\n","sourceCodeStart":3986,"sourceCodeEnd":4022,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/markdown/src/markdown.rs#L3986-L4022","documentation":"Asserts, while replacing a rendered markdown checkbox, that the pending line's source-mapping range exists so the toggle callback can be attached to the correct source span. Failure means the pending-line bookkeeping (source index/run lengths) went out of sync with the rendered runs — an internal renderer invariant break, typically after a truncation or run-splitting change.","triggerScenarios":"Thrown at crates/markdown/src/markdown.rs:3908 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Guard with Option and skip attaching the toggle callback when mappings are absent rather than panicking","Add a renderer test rendering a task-list line then mutating it to keep source mappings consistent","Audit pending_line truncation logic (runs.last_mut().len -= 1, current_source_index) for the desync"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}