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
0834d77b
Commit
0834d77b
authored
Mar 14, 2003
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Accept commas in unquoted attribute values.
This closes SF patch #669683.
parent
080cb326
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
2 deletions
+10
-2
Lib/HTMLParser.py
Lib/HTMLParser.py
+1
-1
Lib/sgmllib.py
Lib/sgmllib.py
+1
-1
Lib/test/test_htmlparser.py
Lib/test/test_htmlparser.py
+4
-0
Lib/test/test_sgmllib.py
Lib/test/test_sgmllib.py
+4
-0
No files found.
Lib/HTMLParser.py
View file @
0834d77b
...
...
@@ -26,7 +26,7 @@ commentclose = re.compile(r'--\s*>')
tagfind = re.compile('
[
a
-
zA
-
Z
][
-
.
a
-
zA
-
Z0
-
9
:
_
]
*
')
attrfind = re.compile(
r'
\
s
*
([
a
-
zA
-
Z_
][
-
.:
a
-
zA
-
Z_0
-
9
]
*
)(
\
s
*=
\
s
*
'
r'
(
\
'[^
\
'
]*
\
'
|"[^"]*"|[-a-zA-Z0-9./:;+*%?!&$
\
(
\
)_#=~]*))?'
)
r'
(
\
'[^
\
'
]*
\
'
|"[^"]*"|[-a-zA-Z0-9./
,
:;+*%?!&$
\
(
\
)_#=~]*))?'
)
locatestarttagend
=
re
.
compile
(
r"""
<[a-zA-Z][-.a-zA-Z0-9:_]* # tag name
...
...
Lib/sgmllib.py
View file @
0834d77b
...
...
@@ -34,7 +34,7 @@ commentclose = re.compile(r'--\s*>')
tagfind = re.compile('
[
a
-
zA
-
Z
][
-
_
.
a
-
zA
-
Z0
-
9
]
*
')
attrfind = re.compile(
r'
\
s
*
([
a
-
zA
-
Z_
][
-
:.
a
-
zA
-
Z_0
-
9
]
*
)(
\
s
*=
\
s
*
'
r'
(
\
'[^
\
'
]*
\
'
|"[^"]*"|[-a-zA-Z0-9./:;+*%?!&$
\
(
\
)_#=~
\
'
"]*))?'
)
r'
(
\
'[^
\
'
]*
\
'
|"[^"]*"|[-a-zA-Z0-9./
,
:;+*%?!&$
\
(
\
)_#=~
\
'
"]*))?'
)
class
SGMLParseError
(
RuntimeError
):
...
...
Lib/test/test_htmlparser.py
View file @
0834d77b
...
...
@@ -197,6 +197,10 @@ DOCTYPE html [
self
.
_run_check
(
"""<a b='' c="">"""
,
[
(
"starttag"
,
"a"
,
[(
"b"
,
""
),
(
"c"
,
""
)]),
])
# Regression test for SF patch #669683.
self
.
_run_check
(
"<e a=rgb(1,2,3)>"
,
[
(
"starttag"
,
"e"
,
[(
"a"
,
"rgb(1,2,3)"
)]),
])
def
test_attr_entity_replacement
(
self
):
self
.
_run_check
(
"""<a b='&><"''>"""
,
[
...
...
Lib/test/test_sgmllib.py
View file @
0834d77b
...
...
@@ -200,6 +200,10 @@ DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01//EN'
self
.
check_events
(
"""<a b='' c="">"""
,
[
(
"starttag"
,
"a"
,
[(
"b"
,
""
),
(
"c"
,
""
)]),
])
# Regression test for SF patch #669683.
self
.
check_events
(
"<e a=rgb(1,2,3)>"
,
[
(
"starttag"
,
"e"
,
[(
"a"
,
"rgb(1,2,3)"
)]),
])
def
test_attr_funky_names
(
self
):
self
.
check_events
(
"""<a a.b='v' c:d=v e-f=v>"""
,
[
...
...
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