diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-02-09 18:58:46 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-02-09 18:58:46 +0800 |
| commit | 707a4e7162ad31c0152592cf28f66a55ca38dfd2 (patch) | |
| tree | 1b3061d96a8a8dc6bf7c75a0ec4f12f3358f5630 /parser/src/syntax_checker.rs | |
| parent | 204bb6824bf3555b80ca574ca3edb8ea007c89dd (diff) | |
Add FileNotFound variant to Exit enum
Diffstat (limited to 'parser/src/syntax_checker.rs')
| -rw-r--r-- | parser/src/syntax_checker.rs | 20 |
1 files changed, 0 insertions, 20 deletions
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::<String>(); - - 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(()) } |
