summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2014-08-02 15:36:12 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2014-08-02 15:36:12 (GMT)
commit6fc16d81af0ec11e79a17e2af12e8653382cef26 (patch)
tree46c2ed00a7cb5efb78bafd818c3e2b9e04a66c01 /Doc
parent11bec7a1b83d0edffbcff29dccbabd660f5a9a7b (diff)
downloadcpython-6fc16d81af0ec11e79a17e2af12e8653382cef26.zip
cpython-6fc16d81af0ec11e79a17e2af12e8653382cef26.tar.gz
cpython-6fc16d81af0ec11e79a17e2af12e8653382cef26.tar.bz2
#21047: set the default value for the *convert_charrefs* argument of HTMLParser to True. Patch by Berker Peksag.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/html.parser.rst9
1 files changed, 5 insertions, 4 deletions
diff --git a/Doc/library/html.parser.rst b/Doc/library/html.parser.rst
index 67ae139..b84c60b 100644
--- a/Doc/library/html.parser.rst
+++ b/Doc/library/html.parser.rst
@@ -16,15 +16,13 @@
This module defines a class :class:`HTMLParser` which serves as the basis for
parsing text files formatted in HTML (HyperText Mark-up Language) and XHTML.
-.. class:: HTMLParser(*, convert_charrefs=False)
+.. class:: HTMLParser(*, convert_charrefs=True)
Create a parser instance able to parse invalid markup.
- If *convert_charrefs* is ``True`` (default: ``False``), all character
+ If *convert_charrefs* is ``True`` (the default), all character
references (except the ones in ``script``/``style`` elements) are
automatically converted to the corresponding Unicode characters.
- The use of ``convert_charrefs=True`` is encouraged and will become
- the default in Python 3.5.
An :class:`.HTMLParser` instance is fed HTML data and calls handler methods
when start tags, end tags, text, comments, and other markup elements are
@@ -37,6 +35,9 @@ parsing text files formatted in HTML (HyperText Mark-up Language) and XHTML.
.. versionchanged:: 3.4
*convert_charrefs* keyword argument added.
+ .. versionchanged:: 3.5
+ The default value for argument *convert_charrefs* is now ``True``.
+
Example HTML Parser Application
-------------------------------