diff --git a/crates/nuwiki-lsp/tests/link_health.rs b/crates/nuwiki-lsp/tests/link_health.rs index 0a37736..3c626af 100644 --- a/crates/nuwiki-lsp/tests/link_health.rs +++ b/crates/nuwiki-lsp/tests/link_health.rs @@ -343,11 +343,13 @@ fn find_section_range_misses_when_absent() { } #[test] -fn find_section_range_only_matches_h1() { +fn find_section_range_matches_any_heading_level() { + // Section replacement accepts any heading level so + // VimwikiGenerateTagLinks stays idempotent when tag sections live + // under non-h1 headings (e.g. `== Tag: foo ==`). let src = "== Contents ==\n- [[A]]\n"; let ast = parse(src); - // h2 — should not match. - assert!(ops::find_section_range(&ast, "Contents").is_none()); + assert!(ops::find_section_range(&ast, "Contents").is_some()); } // ===== toc_edit =====