{"record":{"id":"aa15d780883ed60f","repo":"rust-lang/mdBook","slug":"failed-to-parse-summary-md-line-column","errorCode":null,"errorMessage":"failed to parse SUMMARY.md line {}, column {}: {}","messagePattern":"failed to parse SUMMARY\\.md line (.+?), column (.+?): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/mdbook-summary/src/lib.rs","lineNumber":568,"sourceCode":"                    );\n\n                    link.number = Some(number);\n\n                    return Ok(SummaryItem::Link(link));\n                }\n                other => {\n                    warn!(\"Expected a start of a link, actually got {:?}\", other);\n                    bail!(self.parse_error(\n                        \"The link items for nested chapters must only contain a hyperlink\"\n                    ));\n                }\n            }\n        }\n    }\n\n    fn parse_error<D: Display>(&self, msg: D) -> Error {\n        let (line, col) = self.current_location();\n        anyhow::anyhow!(\n            \"failed to parse SUMMARY.md line {}, column {}: {}\",\n            line,\n            col,\n            msg\n        )\n    }\n\n    /// Try to parse the title line.\n    fn parse_title(&mut self) -> Option<String> {\n        loop {\n            match self.next_event() {\n                Some(Event::Start(Tag::Heading {\n                    level: HeadingLevel::H1,\n                    ..\n                })) => {\n                    debug!(\"Found a h1 in the SUMMARY\");\n\n                    let tags = collect_events!(self.stream, end TagEnd::Heading(HeadingLevel::H1));","sourceCodeStart":550,"sourceCodeEnd":586,"githubUrl":"https://github.com/rust-lang/mdBook/blob/dc21064fc21d955a0e1f67e65e336883c3e5260b/crates/mdbook-summary/src/lib.rs#L550-L586","documentation":"parse_error is the helper used by SUMMARY.md parsers to construct user-facing errors. It captures the parser's current (line, column) location via current_location and wraps the message with it, so users see exactly where in SUMMARY.md parsing failed.","triggerScenarios":"Any syntax problem in SUMMARY.md that triggers a bail!(self.parse_error(...)) path — malformed links, invalid nesting, bad affix structure, etc. The message shown embeds the line and column of the offending event.","commonSituations":"Hand-editing SUMMARY.md and introducing typos; unbalanced brackets or quotes in links; invalid UTF-8 or inconsistent indentation confusing the Markdown event stream; corrupted SUMMARY after a bad merge.","solutions":["Open SUMMARY.md at the reported line/column and fix the syntax problem described after the location.","Validate the overall structure: optional prefix chapters, one `# Summary` header, one numbered list, then suffix chapters.","Regenerate a known-good SUMMARY.md (e.g. from a fresh `mdbook init`) and re-apply entries carefully."],"exampleFix":"// before: SUMMARY.md line 3, column 5\n- [Chapter 1](ch1.md]\n\n// after\n- [Chapter 1](ch1.md)","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Rust\nmatch mdbook::build(&mut book) {\n    Err(e) if e.to_string().starts_with(\"failed to parse SUMMARY.md\") => {\n        eprintln!(\"Fix SUMMARY.md at the reported line/column: {e}\");\n        std::process::exit(1);\n    }\n    Err(e) => return Err(e),\n    Ok(()) => {},\n}","preventionTips":["Use a Markdown linter on SUMMARY.md before building.","Re-run mdbook immediately after each SUMMARY.md edit to localize failures."],"tags":["summary","parse","location","mdbook"],"backgroundTag":"summary-parse-error","analyzedSha":"dc21064fc21d955a0e1f67e65e336883c3e5260b","analyzedAt":"2026-09-01T10:15:12.134Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}