" and "]] >" no longer end the CDATA section. Make CDATA section parsing context depending. Add private method HTMLParser._set_support_cdata() to change the context....">

[3.14] gh-135661: Fix CDATA section parsing in HTMLParser (GH-135665) by miss-islington · Pull Request #137772 · python/cpython (original) (raw)

This was referenced

Aug 14, 2025

ezio-melotti

@serhiy-storchaka

…5665)

"] ]>" and "]] >" no longer end the CDATA section.

Make CDATA section parsing context depending. Add private method HTMLParser._set_support_cdata() to change the context. If called with True, "<[CDATA[" starts a CDATA section which ends with "]]>". If called with False, "<[CDATA[" starts a bogus comments which ends with ">". (cherry picked from commit 0cbbfc4)

Co-authored-by: Serhiy Storchaka storchaka@gmail.com

kumaraditya303 pushed a commit to miss-islington/cpython that referenced this pull request

Sep 9, 2025

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})