fix(anatomy): R5.4 field segments and code spans on the generator alphabet, wiki and liquid brackets refused in list items, linear guard

This commit is contained in:
bchanot committed 2026-10-23 13:58:14 +02:00
1 parent 1b12d90325
commit aeb5050502
10 files changed
+325 -48

No files matched your search

+4 -3
View File
@@ -72,12 +72,13 @@ const EQUINE_SAFE: &str = "[]&#{}=<>\"':;()/%?-.,«»…≠°—+";
fn equine_safe(probe: &str) -> bool {
// A leading or trailing space becomes two spaces once the probe sits in its sentence; the
// inline constructs (links, wiki links, autolinks, character references) are probed apart.
// inline constructs (links, wiki links, autolinks, character references) are probed apart;
// the list-item fields refuse the wiki and liquid brackets whole (none in the equine ones).
let tag = probe.match_indices('<').any(|(at, _)| {
probe[at + 1..].starts_with(|c: char| c.is_ascii_alphabetic() || "/!?".contains(c))
});
let construct = tag
|| ["](", "][", "![", "[[ ", " ]]", "&", "`"]
|| ["](", "][", "![", "[[", "]]", "{%", "%}", "&", "`"]
.iter()
.any(|m| probe.contains(m));
!construct
@@ -145,6 +146,6 @@ fn every_probe_is_formatted_as_the_typescript_or_refused() {
"silent differences for {} probes: {silent:?}",
silent.len()
);
assert_eq!(same + refused, 790);
assert_eq!(same + refused, 798);
println!("{same} identical, {refused} refused");
}