allow raw elements if they include a dash
This commit is contained in:
1 parent
46cc07e048
commit
209a55da69
5 files changed
+141
-18
No files matched your search
@@ -50,7 +50,17 @@ impl Parse for BodyNode {
|
||||
return Ok(BodyNode::Text(stream.parse()?));
|
||||
}
|
||||
|
||||
// if this is a dash-separated path, it's a web component (custom element)
|
||||
let body_stream = stream.fork();
|
||||
if let Ok(ElementName::Custom(name)) = body_stream.parse::<ElementName>() {
|
||||
println!("name: {}", name);
|
||||
if name.contains('-') && body_stream.peek(token::Brace) {
|
||||
return Ok(BodyNode::Element(stream.parse::<Element>()?));
|
||||
}
|
||||
}
|
||||
|
||||
let body_stream = stream.fork();
|
||||
|
||||
if let Ok(path) = body_stream.parse::<syn::Path>() {
|
||||
// this is an Element if path match of:
|
||||
// - one ident
|
||||
|
||||
Reference in new issue
Block a user