lib/nokogiri/css/parser.y in nokogiri-maglev--1.5.0.1 vs lib/nokogiri/css/parser.y in nokogiri-maglev--1.5.2
- old
+ new
@@ -67,28 +67,31 @@
;
class
: '.' IDENT { result = Node.new(:CLASS_CONDITION, [val[1]]) }
;
element_name
+ : namespaced_ident
+ | '*' { result = Node.new(:ELEMENT_NAME, val) }
+ ;
+ namespaced_ident
: namespace '|' IDENT {
result = Node.new(:ELEMENT_NAME,
[[val.first, val.last].compact.join(':')]
)
}
| IDENT {
name = @namespaces.key?('xmlns') ? "xmlns:#{val.first}" : val.first
result = Node.new(:ELEMENT_NAME, [name])
}
- | '*' { result = Node.new(:ELEMENT_NAME, val) }
;
namespace
: IDENT { result = val[0] }
|
;
attrib
- : LSQUARE IDENT attrib_val_0or1 RSQUARE {
+ : LSQUARE namespaced_ident attrib_val_0or1 RSQUARE {
result = Node.new(:ATTRIBUTE_CONDITION,
- [Node.new(:ELEMENT_NAME, [val[1]])] + (val[2] || [])
+ [val[1]] + (val[2] || [])
)
}
| LSQUARE function attrib_val_0or1 RSQUARE {
result = Node.new(:ATTRIBUTE_CONDITION,
[val[1]] + (val[2] || [])