mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-27 14:40:44 +00:00
fix: Element must be of lowercase letters only
This commit is contained in:
parent
690efade88
commit
37f7fe2ac6
1 changed files with 2 additions and 8 deletions
|
@ -33,19 +33,13 @@ impl Parse for BodyNode {
|
||||||
// this is an Element if path match of:
|
// this is an Element if path match of:
|
||||||
// - one ident
|
// - one ident
|
||||||
// - followed by `{`
|
// - followed by `{`
|
||||||
// - have no `PathArguments`
|
// - all chars lowercase
|
||||||
// - starts with lowercase
|
|
||||||
//
|
//
|
||||||
// example:
|
// example:
|
||||||
// div {}
|
// div {}
|
||||||
if let Some(ident) = path.get_ident() {
|
if let Some(ident) = path.get_ident() {
|
||||||
if body_stream.peek(token::Brace)
|
if body_stream.peek(token::Brace)
|
||||||
&& ident
|
&& ident.to_string().chars().all(char::is_lowercase)
|
||||||
.to_string()
|
|
||||||
.chars()
|
|
||||||
.next()
|
|
||||||
.unwrap()
|
|
||||||
.is_ascii_lowercase()
|
|
||||||
{
|
{
|
||||||
return Ok(BodyNode::Element(stream.parse::<Element>()?));
|
return Ok(BodyNode::Element(stream.parse::<Element>()?));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue