Lexer: only pop elements when needed.
This commit is contained in:
parent
c8c9da2922
commit
9ee9ec14cb
|
@ -477,7 +477,7 @@ module Oga
|
||||||
add_token(:T_ELEM_NS, ns)
|
add_token(:T_ELEM_NS, ns)
|
||||||
end
|
end
|
||||||
|
|
||||||
@elements << name if html
|
@elements << name if html?
|
||||||
|
|
||||||
add_token(:T_ELEM_NAME, name)
|
add_token(:T_ELEM_NAME, name)
|
||||||
|
|
||||||
|
@ -532,14 +532,14 @@ module Oga
|
||||||
emit_buffer
|
emit_buffer
|
||||||
add_token(:T_ELEM_END, nil)
|
add_token(:T_ELEM_END, nil)
|
||||||
|
|
||||||
@elements.pop
|
@elements.pop if html?
|
||||||
};
|
};
|
||||||
|
|
||||||
# Self closing elements that are not handled by the HTML mode.
|
# Self closing elements that are not handled by the HTML mode.
|
||||||
'/>' => {
|
'/>' => {
|
||||||
add_token(:T_ELEM_END, nil)
|
add_token(:T_ELEM_END, nil)
|
||||||
|
|
||||||
@elements.pop
|
@elements.pop if html?
|
||||||
};
|
};
|
||||||
|
|
||||||
# Note that this rule should be declared at the very bottom as it
|
# Note that this rule should be declared at the very bottom as it
|
||||||
|
|
Loading…
Reference in New Issue