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 @ ('`' | ':' | '~') => {
|
||||
let fence_length = 1 + (&mut chars).take_while(|c| *c == f).count();
|
||||
let spec = &line_t[fence_length..].trim_start();
|
||||
let valid_spec = if f == ':' && !spec.starts_with('=') {
|
||||
spec.chars().next().map_or(true, attr::is_name_start)
|
||||
&& spec.chars().skip(1).all(attr::is_name)
|
||||
let valid_spec = if f == ':' {
|
||||
spec.chars().all(attr::is_name)
|
||||
} else {
|
||||
!spec.chars().any(char::is_whitespace) && !spec.chars().any(|c| c == '`')
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue