Remove div shorthand
This commit is contained in:
parent
359079ca6c
commit
da86d54b05
2 changed files with 9 additions and 13 deletions
|
@ -190,10 +190,6 @@ impl<'cx, 'i> Parser<'cx, 'i> {
|
||||||
let name = try!(self.name());
|
let name = try!(self.name());
|
||||||
try!(self.element(sp, &name));
|
try!(self.element(sp, &name));
|
||||||
},
|
},
|
||||||
// Shorthand div element
|
|
||||||
[dot!(), ident!(sp, _), ..] => {
|
|
||||||
try!(self.element(sp, "div"));
|
|
||||||
},
|
|
||||||
// Block
|
// Block
|
||||||
[TokenTree::Delimited(_, ref d), ..] if d.delim == DelimToken::Brace => {
|
[TokenTree::Delimited(_, ref d), ..] if d.delim == DelimToken::Brace => {
|
||||||
self.shift(1);
|
self.shift(1);
|
||||||
|
|
|
@ -339,10 +339,10 @@ fn class_shorthand() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn div_class_shorthand() {
|
fn class_shorthand_with_space() {
|
||||||
let mut s = String::new();
|
let mut s = String::new();
|
||||||
html!(s, p { "Hi, " .name { "Lyra" } "!" }).unwrap();
|
html!(s, p { "Hi, " span .name { "Lyra" } "!" }).unwrap();
|
||||||
assert_eq!(s, "<p>Hi, <div class=\"name\">Lyra</div>!</p>");
|
assert_eq!(s, "<p>Hi, <span class=\"name\">Lyra</span>!</p>");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -353,15 +353,15 @@ fn classes_shorthand() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn div_classes_shorthand() {
|
fn classes_shorthand_with_space() {
|
||||||
let mut s = String::new();
|
let mut s = String::new();
|
||||||
html!(s, p { "Hi, " .name.here { "Lyra" } "!" }).unwrap();
|
html!(s, p { "Hi, " span .name .here { "Lyra" } "!" }).unwrap();
|
||||||
assert_eq!(s, "<p>Hi, <div class=\"name here\">Lyra</div>!</p>");
|
assert_eq!(s, "<p>Hi, <span class=\"name here\">Lyra</span>!</p>");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn div_classes_shorthand_with_attrs() {
|
fn classes_shorthand_with_attrs() {
|
||||||
let mut s = String::new();
|
let mut s = String::new();
|
||||||
html!(s, p { "Hi, " .name.here id="thing" { "Lyra" } "!" }).unwrap();
|
html!(s, p { "Hi, " span.name.here id="thing" { "Lyra" } "!" }).unwrap();
|
||||||
assert_eq!(s, "<p>Hi, <div class=\"name here\" id=\"thing\">Lyra</div>!</p>");
|
assert_eq!(s, "<p>Hi, <span class=\"name here\" id=\"thing\">Lyra</span>!</p>");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue