diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/HtmlParser.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/src/HtmlParser.c b/src/HtmlParser.c index 8a595ac..a5cde1c 100644 --- a/src/HtmlParser.c +++ b/src/HtmlParser.c @@ -257,32 +257,13 @@ static void html_parser_parse_attribute_value(HtmlParser *self) { self->attribute_value.size = (self->source + self->offset) - self->attribute_value.data; } -static void html_parser_goto_end_of_js_string(HtmlParser *self, char quote_symbol) { - int escape_quote = 0; - for(;;) { - char c = html_parser_next_char(self); - if(!escape_quote && c == quote_symbol) { - return; - } else if(c == '\\') { - escape_quote = !escape_quote; - } else if(c == '\0') { - return; - } else { - escape_quote = 0; - } - } -} - static int html_parser_goto_script_end_tag(HtmlParser *self) { int res = 0; self->text.data = self->source + self->offset; self->text.size = 0; for(;;) { char c = html_parser_peek_char(self); - if(c == '"' || c == '\'') { - html_parser_advance_char(self); - html_parser_goto_end_of_js_string(self, c); - } else if(c == '<' && self->offset + 7 < self->source_len && memcmp(self->source + self->offset + 1, "/script", 7) == 0) { + if(c == '<' && self->offset + 7 < self->source_len && memcmp(self->source + self->offset + 1, "/script", 7) == 0) { self->text.size = (self->source + self->offset) - self->text.data; strip(self->text.data, self->text.size, &self->text_stripped.data, &self->text_stripped.size, is_whitespace); self->offset += 7; @@ -346,7 +327,6 @@ static int html_parser_parse_tag_start(HtmlParser *self) { if(self->inside_script_tag) { self->inside_script_tag = 0; - /* <script> tags require special handling since they can have </script> inside a javascript string */ return html_parser_goto_script_end_tag(self); } return 0; |