Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
554a3b82
Commit
554a3b82
authored
May 24, 2010
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #6662: Fix parsing of malformatted charref (&#bad;)
parent
f0757a29
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
Lib/HTMLParser.py
Lib/HTMLParser.py
+3
-0
Lib/test/test_htmlparser.py
Lib/test/test_htmlparser.py
+7
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/HTMLParser.py
View file @
554a3b82
...
...
@@ -175,6 +175,9 @@ class HTMLParser(markupbase.ParserBase):
i = self.updatepos(i, k)
continue
else:
if ";" in rawdata[i:]: #bail by consuming &#
self.handle_data(rawdata[0:2])
i = self.updatepos(i, 2)
break
elif startswith('
&
', i):
match = entityref.match(rawdata, i)
...
...
Lib/test/test_htmlparser.py
View file @
554a3b82
...
...
@@ -313,6 +313,13 @@ DOCTYPE html [
(
"starttag"
,
"html"
,
[(
"foo"
,
u"
\
u20AC
&aa&unsupported;"
)])
])
def
test_malformatted_charref
(
self
):
self
.
_run_check
(
"<p>&#bad;</p>"
,
[
(
"starttag"
,
"p"
,
[]),
(
"data"
,
"&#bad;"
),
(
"endtag"
,
"p"
),
])
def
test_main
():
test_support
.
run_unittest
(
HTMLParserTestCase
)
...
...
Misc/NEWS
View file @
554a3b82
...
...
@@ -29,6 +29,8 @@ C-API
Library
-------
- Issue #6662: Fix parsing of malformatted charref (&#bad;)
- Issue #8016: Add the CP858 codec.
- Issue #3924: Ignore cookies with invalid "version" field in cookielib.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment