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:
commit
d99b24e035
@ -145,6 +145,9 @@ Raw text elements
|
|||||||
</ </s </st </sty </styl
|
</ </s </st </sty </styl
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
</SCRIPT>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
(fragment
|
(fragment
|
||||||
@ -157,6 +160,11 @@ Raw text elements
|
|||||||
(start_tag (tag_name))
|
(start_tag (tag_name))
|
||||||
(raw_text)
|
(raw_text)
|
||||||
(end_tag (tag_name)))
|
(end_tag (tag_name)))
|
||||||
|
(text)
|
||||||
|
(script_element
|
||||||
|
(start_tag (tag_name))
|
||||||
|
(raw_text)
|
||||||
|
(end_tag (tag_name)))
|
||||||
(text))
|
(text))
|
||||||
|
|
||||||
==================================
|
==================================
|
||||||
|
@ -123,12 +123,12 @@ struct Scanner {
|
|||||||
lexer->mark_end(lexer);
|
lexer->mark_end(lexer);
|
||||||
|
|
||||||
const string &end_delimiter = tags.back().type == SCRIPT
|
const string &end_delimiter = tags.back().type == SCRIPT
|
||||||
? "</script"
|
? "</SCRIPT"
|
||||||
: "</style";
|
: "</STYLE";
|
||||||
|
|
||||||
unsigned delimiter_index = 0;
|
unsigned delimiter_index = 0;
|
||||||
while (lexer->lookahead) {
|
while (lexer->lookahead) {
|
||||||
if (lexer->lookahead == end_delimiter[delimiter_index]) {
|
if (towupper(lexer->lookahead) == end_delimiter[delimiter_index]) {
|
||||||
delimiter_index++;
|
delimiter_index++;
|
||||||
if (delimiter_index == end_delimiter.size()) break;
|
if (delimiter_index == end_delimiter.size()) break;
|
||||||
lexer->advance(lexer, false);
|
lexer->advance(lexer, false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user