From 707a4e7162ad31c0152592cf28f66a55ca38dfd2 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 9 Feb 2026 18:58:46 +0800 Subject: Add FileNotFound variant to Exit enum --- parser/src/syntax_checker.rs | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'parser/src/syntax_checker.rs') diff --git a/parser/src/syntax_checker.rs b/parser/src/syntax_checker.rs index c8e654c..334fa9d 100644 --- a/parser/src/syntax_checker.rs +++ b/parser/src/syntax_checker.rs @@ -197,25 +197,5 @@ pub fn check_markdown_syntax(i: &String) -> Result<(), Exit> { }); } - // Check if all anchors have corresponding headings - for (anchor, line_num, pos) in anchors { - // Normalize anchor for comparison: convert to lowercase and filter characters - let normalized_anchor = anchor - .to_lowercase() - .chars() - .filter(|c| c.is_alphanumeric() || *c == '-' || *c == '_') - .collect::(); - - if !heading_ids.contains(&normalized_anchor) { - return Err(Exit::SyntaxError { - content: lines[(line_num - 1) as usize].to_string(), - reason: format!("Anchor '#{}' has no corresponding heading", anchor), - line: line_num, - begin: pos, - end: pos + anchor.len() as i64, - }); - } - } - Ok(()) } -- cgit