Explorar o código

LibWeb: Fix tokenizer swallowing an extra token after a named entity

Andreas Kling %!s(int64=5) %!d(string=hai) anos
pai
achega
ab4c03ce2d
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      Libraries/LibWeb/Parser/HTMLTokenizer.cpp

+ 1 - 1
Libraries/LibWeb/Parser/HTMLTokenizer.cpp

@@ -1302,7 +1302,7 @@ _StartOfFunction:
                 auto match = HTML::codepoints_from_entity(m_decoded_input.substring_view(byte_offset, m_decoded_input.length() - byte_offset - 1));
 
                 if (match.has_value()) {
-                    for (size_t i = 0; i < match.value().entity.length(); ++i) {
+                    for (size_t i = 0; i < match.value().entity.length() - 1; ++i) {
                         m_prev_utf8_iterator = m_utf8_iterator;
                         ++m_utf8_iterator;
                     }