{"record":{"id":"9b0fe0cfe97b8763","repo":"iced-rs/iced","slug":"table-row","errorCode":null,"errorMessage":"table row","messagePattern":"table row","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"widget/src/markdown.rs","lineNumber":937,"sourceCode":"\n                let Scope::Table {\n                    alignment,\n                    columns,\n                    rows,\n                    current,\n                } = stack.last_mut()?\n                else {\n                    return None;\n                };\n\n                if columns.len() < alignment.len() {\n                    columns.push(Column {\n                        header: std::mem::take(current),\n                        alignment: alignment[columns.len()],\n                    });\n                } else {\n                    rows.last_mut()\n                        .expect(\"table row\")\n                        .cells\n                        .push(std::mem::take(current));\n                }\n\n                None\n            }\n            _ => None,\n        },\n        pulldown_cmark::Event::Text(text) if !metadata => {\n            if code_block {\n                code.push_str(&text);\n\n                #[cfg(feature = \"highlighter\")]\n                if let Some(highlighter) = &mut code_parser {\n                    for line in text.lines() {\n                        code_lines.push(Text::new(highlighter.parse_line(line).to_vec()));\n                    }\n                }","sourceCodeStart":919,"sourceCodeEnd":955,"githubUrl":"https://github.com/iced-rs/iced/blob/d146509d893945de5c304cfaf4301335eee278bd/widget/src/markdown.rs#L919-L955","documentation":"The markdown parser asserts that a table row exists when appending a cell to it via rows.last_mut().expect(\"table row\"). Rows are pushed when a table's separator/header line is parsed, so this panic means a cell line was processed without a preceding valid table header/separator - an internal parser invariant violation.","triggerScenarios":"Feeding markdown where a table body line (|a|b|) appears without a matching header+delimiter row, or malformed delimiter rows (e.g. |---|---| with wrong column alignment array length) such that the parser reaches the cell branch with rows empty.","commonSituations":"User-supplied markdown content with a near-miss table syntax (missing separator line, leading blank line removal quirks), or content truncated mid-table; can also surface when a previous alignment array indexed columns.len() out of range earlier in the same block.","solutions":["Validate/sanitize the markdown before rendering: every table body must be preceded by a header row and a |---| delimiter row.","Inspect the input around the failing table and fix its syntax (missing or malformed delimiter line is the usual cause).","If content is untrusted, escape or pre-parse tables defensively, or pin the iced/iced_widgets version where your input is known to parse.","Report/upgrade: if the input is valid CommonMark, this is a parser bug - check for fixes in newer iced_widget releases."],"exampleFix":"// before (input)\n| a | b |\n| c | d |\n// after (input - add delimiter row)\n| a | b |\n|---|---|\n| c | d |","handlingStrategy":"validation","validationCode":"// check tables are well-formed before handing markdown to the widget\nfn table_has_delimiter(md: &str) -> bool {\n    // every line starting with '|' body must be preceded by a |---| row\n    let mut prev_sep = false;\n    for line in md.lines() {\n        let is_pipe = line.trim_start().starts_with('|');\n        let is_sep = is_pipe && line.chars().all(|c| c == '|' || c == '-' || c == ':' || c.is_whitespace());\n        if is_pipe && !is_sep && !prev_sep { return false; }\n        prev_sep = is_sep;\n    }\n    true\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Sanitize user-supplied markdown tables before rendering.","Add a unit test rendering all markdown fixtures used in your app.","Pin the iced version your content is verified against.","Report valid-CommonMark inputs that panic as upstream bugs."],"tags":["markdown","parser","panic","table"],"backgroundTag":"internal-invariant-violation","analyzedSha":"d146509d893945de5c304cfaf4301335eee278bd","analyzedAt":"2026-09-11T16:54:14.229Z","contentChangedAt":"2026-09-11T16:54:14.229Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}