瀏覽代碼

fix: element start with lowercase letter again :D

Muhannad Alrusayni 3 年之前
父節點
當前提交
03a14f4a86
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. 7 2
      packages/core-macro/src/rsx/node.rs

+ 7 - 2
packages/core-macro/src/rsx/node.rs

@@ -33,13 +33,18 @@ impl Parse for BodyNode {
             // this is an Element if path match of:
             // - one ident
             // - followed by `{`
-            // - all chars lowercase
+            // - 1st char is lowercase
             //
             // example:
             // div {}
             if let Some(ident) = path.get_ident() {
                 if body_stream.peek(token::Brace)
-                    && ident.to_string().chars().all(char::is_lowercase)
+                    && ident
+                        .to_string()
+                        .chars()
+                        .next()
+                        .unwrap()
+                        .is_ascii_lowercase()
                 {
                     return Ok(BodyNode::Element(stream.parse::<Element>()?));
                 }