block: enforce valid div classes

This commit is contained in:
Noah Hellman 2023-01-31 21:23:50 +01:00
parent 30351500bb
commit 6a94e694f9
2 changed files with 8 additions and 4 deletions

View file

@ -262,11 +262,11 @@ impl<I: Iterator<Item = char>> Parser<I> {
}
}
fn is_name_start(c: char) -> bool {
pub fn is_name_start(c: char) -> bool {
c.is_ascii_alphanumeric() || matches!(c, '_' | ':')
}
fn is_name(c: char) -> bool {
pub fn is_name(c: char) -> bool {
is_name_start(c) || c.is_ascii_digit() || matches!(c, '-')
}