From 0719b2de6572ea6027f8c4407154dd408dc29901 Mon Sep 17 00:00:00 2001 From: Noah Hellman Date: Sun, 12 Mar 2023 17:12:56 +0100 Subject: [PATCH] block: fix class attribute parsing match reference implementation --- src/block.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/block.rs b/src/block.rs index c7f5692..d108c62 100644 --- a/src/block.rs +++ b/src/block.rs @@ -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 == '`') };