block: fix class attribute parsing
match reference implementation
This commit is contained in:
parent
33d8215a2a
commit
0719b2de65
1 changed files with 2 additions and 3 deletions
|
@ -734,9 +734,8 @@ impl IdentifiedBlock {
|
||||||
f @ ('`' | ':' | '~') => {
|
f @ ('`' | ':' | '~') => {
|
||||||
let fence_length = 1 + (&mut chars).take_while(|c| *c == f).count();
|
let fence_length = 1 + (&mut chars).take_while(|c| *c == f).count();
|
||||||
let spec = &line_t[fence_length..].trim_start();
|
let spec = &line_t[fence_length..].trim_start();
|
||||||
let valid_spec = if f == ':' && !spec.starts_with('=') {
|
let valid_spec = if f == ':' {
|
||||||
spec.chars().next().map_or(true, attr::is_name_start)
|
spec.chars().all(attr::is_name)
|
||||||
&& spec.chars().skip(1).all(attr::is_name)
|
|
||||||
} else {
|
} else {
|
||||||
!spec.chars().any(char::is_whitespace) && !spec.chars().any(|c| c == '`')
|
!spec.chars().any(char::is_whitespace) && !spec.chars().any(|c| c == '`')
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue