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
|
||||
</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))
|
||||
|
||||
==================================
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue