Ignore nested element start tags
This ensures that Oga is able to tokenize input such as the following:
<script<script>foo</script>
Oga will now treat this as:
<script>foo</script>
This is based on libxml behaviour, which seems to differ a bit from
Chromium which treats the node as a text node. This however would
require complex look-ahead logic (as far as I can tell) that I really
don't want to implement in Oga.
Fixes #186
This commit is contained in:
2 files changed
+20
No files matched your search
@@ -389,6 +389,7 @@
|
||||
|
||||
element_start = '<' ident_char;
|
||||
element_end = '</';
|
||||
element_start_pattern = '<' identifier (':' identifier)?;
|
||||
|
||||
# Machine used for lexing the name/namespace of an element.
|
||||
element_name := |*
|
||||
@@ -551,6 +552,7 @@
|
||||
# Machine used for processing the contents of an XML element's starting tag.
|
||||
element_head := |*
|
||||
newline => advance_newline;
|
||||
element_start_pattern;
|
||||
|
||||
# Attribute names and namespaces.
|
||||
identifier ':' => {
|
||||
@@ -578,6 +580,7 @@
|
||||
# tag.
|
||||
html_element_head := |*
|
||||
newline => advance_newline;
|
||||
element_start_pattern;
|
||||
|
||||
html_identifier => {
|
||||
callback(id_on_attribute, data, encoding, ts, te);
|
||||
|
||||
Reference in new issue
Block a user