Skip to content

Commit

Permalink
feat(templ): support full syntax for csssyntaxraw
Browse files Browse the repository at this point in the history
  • Loading branch information
fiji-flo committed Jan 25, 2025
1 parent 0d13e31 commit 1d78439
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions crates/css-syntax/src/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -691,16 +691,22 @@ pub fn write_formal_syntax_from_syntax(
value_definition_url: &str,
syntax_tooltip: &'_ HashMap<LinkedToken, String>,
) -> Result<String, SyntaxError> {
let syntax_str = syntax_str.into();
let (name, syntax, skip_first) = if let Some((name, syntax)) = syntax_str.split_once("=") {
(name, syntax.trim().to_string(), false)
} else {
("dummy", syntax_str, true)
};
let syntax = Syntax {
name: "dummy".to_string(),
syntax: syntax_str.into(),
name: name.trim().to_string(),
syntax,
};
write_formal_syntax_internal(
syntax,
locale_str,
value_definition_url,
syntax_tooltip,
true,
skip_first,
)
}

Expand Down

0 comments on commit 1d78439

Please sign in to comment.