Merge pull request #11 from ikatyang/fix/raw-text-end-tag-case-insensitive

fix: raw text end tags should be case insensitive
This commit is contained in:
Max Brunsfeld 2019-10-04 09:59:33 -07:00 committed by GitHub
commit d99b24e035
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View File

@ -145,6 +145,9 @@ Raw text elements
</ </s </st </sty </styl
</style>
<script>
</SCRIPT>
---
(fragment
@ -157,6 +160,11 @@ Raw text elements
(start_tag (tag_name))
(raw_text)
(end_tag (tag_name)))
(text)
(script_element
(start_tag (tag_name))
(raw_text)
(end_tag (tag_name)))
(text))
==================================

View File

@ -123,12 +123,12 @@ struct Scanner {
lexer->mark_end(lexer);
const string &end_delimiter = tags.back().type == SCRIPT
? "</script"
: "</style";
? "</SCRIPT"
: "</STYLE";
unsigned delimiter_index = 0;
while (lexer->lookahead) {
if (lexer->lookahead == end_delimiter[delimiter_index]) {
if (towupper(lexer->lookahead) == end_delimiter[delimiter_index]) {
delimiter_index++;
if (delimiter_index == end_delimiter.size()) break;
lexer->advance(lexer, false);