" and "]] >" no longer end the CDATA section. Issue: HTMLParser differences from the HTML5 specification #135661">

gh-135661: Fix CDATA section parsing in HTMLParser by serhiy-storchaka · Pull Request #135665 · python/cpython (original) (raw)

@serhiy-storchaka

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

serhiy-storchaka

ezio-melotti

@serhiy-storchaka

encukou

ezio-melotti

@serhiy-storchaka

@serhiy-storchaka

@serhiy-storchaka

@serhiy-storchaka

@serhiy-storchaka

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

Aug 14, 2025

@serhiy-storchaka @miss-islington

…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

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

Aug 14, 2025

@serhiy-storchaka @miss-islington

…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

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request

Aug 14, 2025

@serhiy-storchaka

…onGH-135665)

"] ]>" 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

serhiy-storchaka added a commit that referenced this pull request

Aug 14, 2025

@miss-islington @serhiy-storchaka

…GH-137773)

"] ]>" 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

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request

Aug 17, 2025

@serhiy-storchaka

…onGH-135665)

"] ]>" 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

serhiy-storchaka added a commit to miss-islington/cpython that referenced this pull request

Aug 17, 2025

@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

Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull request

Aug 19, 2025

@serhiy-storchaka @Agent-Hellboy

…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 ">".

hugovk pushed a commit that referenced this pull request

Sep 8, 2025

@miss-islington @serhiy-storchaka

…#137772)

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

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

Sep 9, 2025

Yhg1s pushed a commit that referenced this pull request

Oct 6, 2025

@serhiy-storchaka

…#137774)

"] ]>" 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)

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

Oct 6, 2025

@serhiy-storchaka @miss-islington

…onGH-135665) (pythonGH-137774)

"] ]>" 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) (cherry picked from commit dcf2476)

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

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

Oct 6, 2025

@serhiy-storchaka @miss-islington

…onGH-135665) (pythonGH-137774)

"] ]>" 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) (cherry picked from commit dcf2476)

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

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

Oct 6, 2025

@serhiy-storchaka @miss-islington

…onGH-135665) (pythonGH-137774)

"] ]>" 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) (cherry picked from commit dcf2476)

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

ambv pushed a commit that referenced this pull request

Oct 7, 2025

@miss-islington @serhiy-storchaka

…GH-137774) (GH-139659)

"] ]>" 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) (cherry picked from commit dcf2476)

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

ambv pushed a commit that referenced this pull request

Oct 7, 2025

@miss-islington @serhiy-storchaka

…GH-137774) (GH-139660)

"] ]>" 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) (cherry picked from commit dcf2476)

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

ambv added a commit that referenced this pull request

Oct 7, 2025

…H-137774) (GH-139661)

"] ]>" 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) (cherry picked from commit dcf2476)

Co-authored-by: Serhiy Storchaka storchaka@gmail.com Co-authored-by: Łukasz Langa lukasz@langa.pl

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 }})