mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
"] ]>" 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 commit0cbbfc4621) (cherry picked from commitdcf24768c9) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
5 lines
351 B
ReStructuredText
5 lines
351 B
ReStructuredText
Fix CDATA section parsing in :class:`html.parser.HTMLParser` according to
|
|
the HTML5 standard: ``] ]>`` and ``]] >`` no longer end the CDATA section.
|
|
Add private method ``_set_support_cdata()`` which can be used to specify
|
|
how to parse ``<[CDATA[`` --- as a CDATA section in foreign content
|
|
(SVG or MathML) or as a bogus comment in the HTML namespace.
|