Lex open tags with newlines in them.
This commit is contained in:
parent
ba17996bfc
commit
91fb7523fd
|
@ -404,6 +404,8 @@ module Oga
|
|||
element_head := |*
|
||||
whitespace | '=';
|
||||
|
||||
newline => { advance_line };
|
||||
|
||||
# Attribute names.
|
||||
element_name => { t(:T_ATTR) };
|
||||
|
||||
|
|
|
@ -33,6 +33,14 @@ describe Oga::Lexer do
|
|||
[:T_ELEM_NAME, 'p', 1]
|
||||
]
|
||||
end
|
||||
|
||||
example 'lex an element with a newline in the open tag' do
|
||||
lex("<p\n></p>").should == [
|
||||
[:T_ELEM_OPEN, nil, 1],
|
||||
[:T_ELEM_NAME, 'p', 1],
|
||||
[:T_ELEM_CLOSE, nil, 2]
|
||||
]
|
||||
end
|
||||
end
|
||||
|
||||
context 'elements with attributes' do
|
||||
|
|
Loading…
Reference in New Issue