New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How are tags with dash (-) treated? #106
Comments
Ah good catch. So right now we parse tags names here percy/crates/html-macro/src/tag.rs Line 107 in 344e757
The problem is that we parse a single identifier, yet in this case there are three identifiers. So what we'd want to do in that code above is peek at the next token and see if it's a An example of peeking for punctuation: percy/crates/html-macro/src/tag.rs Line 159 in 344e757
If it is a We'd want a test case here that maybe looked something like #[test]
fn hyphenated_tag_name () {
let expected = VirtualNode::new("color-profile");
HtmlMacroTest {
desc: "Hyphenated tag names work",
generated: html! { <color-profile></color-profile> },
expected,
}
.test();
} The html macro tests are run using
If you're up for it I'd be happy to answer any questions about how to do this if any of the above isn't too clear! Otherwise I can take a look at this next time I'm working on the macro. |
For example
<color-profile>
is a valid svg tag.The text was updated successfully, but these errors were encountered: