fix(frontmatter): Have too few error match too many on close

This commit is contained in:
Ed Page 2025-09-16 11:10:32 -05:00
parent 0cbd02f093
commit b6326d3255
2 changed files with 5 additions and 2 deletions

View File

@ -103,8 +103,11 @@ impl<'s> ScriptSource<'s> {
let close_start = input.current_token_start();
let _ = input.next_slice(len);
let close_end = input.current_token_start();
let fewer_dashes = fence_length - len;
return Err(FrontmatterError::new(
format!("closing code fence has too few `-`"),
format!(
"closing code fence has {fewer_dashes} less `-` than the opening fence"
),
close_start..close_end,
));
}

View File

@ -1,4 +1,4 @@
[ERROR] closing code fence has too few `-`
[ERROR] closing code fence has 1 less `-` than the opening fence
--> script:3:1
|
3 | ---cargo