-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
[3.12] gh-135661: Fix CDATA section parsing in HTMLParser (GH-135665) #137774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Backports to 3.9-3.11 will be created from the 3.12 backport. |
|
This code slightly differs from |
…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>
8bd8188 to
1904262
Compare
|
This includes also #137873. |
|
Thanks @serhiy-storchaka for the PR, and @Yhg1s for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10, 3.11. |
…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>
…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>
|
GH-139659 is a backport of this pull request to the 3.11 branch. |
…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>
|
GH-139660 is a backport of this pull request to the 3.10 branch. |
|
GH-139661 is a backport of this pull request to the 3.9 branch. |
…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>
…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>
…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>
"] ]>" 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)