Skip to content

v2.1.0

Latest

Choose a tag to compare

@kurtmckee kurtmckee released this 02 Aug 21:28
· 15 commits to main since this release
v2.1.0
36924f1

Fixed

  • Close tags more correctly, even if the end tag has trailing text.

    For example, </tag bonus> now closes <tag> correctly.
    The trailing content is not available to parsers.

  • Fix quadratic CPU usage in SGMLParser.feed().

    This can occur when a large document with an unfinished token
    (like <a href="...) is fed into the parser in very small increments.

    The new implementation doesn't significantly change peak memory usage.

Changed

  • Improve the closing tag search behavior of SGMLParser.finish_endtag().

    Previously, the method always searched the entire tag stack
    to close the innermost tag, which had a higher search cost.
    The tag stack is now searched in reverse order
    and breaks on the first matching tag.