This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2005年05月12日 02:30 by jhylton, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Messages (5) | |||
|---|---|---|---|
| msg60736 - (view) | Author: Jeremy Hylton (jhylton) (Python triager) | Date: 2005年05月12日 02:30 | |
The HTML spec describes two ways to encode an attribute value that contains a URI with an ampersand. http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.2.2 >>> from HTMLParser import * >>> class P(HTMLParser): ... def handle_starttag(self, tag, attrs): ... print attrs ... >>> P().feed("<tag attr=\"&\">") [('attr', '&')] >>> P().feed("<tag attr=\"&\">") [('attr', '&')] It seems that each string should produce the same parsed value. I would hazard a guess that the easiest way to make this happen is to extend the current unescape() to unescape character references. Is there any reason not to do that? I'll provide a fix if that sounds like a reasonable answer. |
|||
| msg82199 - (view) | Author: Daniel Diniz (ajaksu2) * (Python triager) | Date: 2009年02月16日 01:01 | |
Maybe the charrefs were lost in the SF -> Roundup transition? |
|||
| msg147268 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2011年11月08日 01:11 | |
unescape() already converts named, decimal and hexadecimal entities, so this can be closed. |
|||
| msg147614 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年11月14日 16:57 | |
New changeset 3c3009f63700 by Ezio Melotti in branch '2.7': #1745761, #755670, #13357, #12629, #1200313: improve attribute handling in HTMLParser. http://hg.python.org/cpython/rev/3c3009f63700 New changeset 16ed15ff0d7c by Ezio Melotti in branch '3.2': #1745761, #755670, #13357, #12629, #1200313: improve attribute handling in HTMLParser. http://hg.python.org/cpython/rev/16ed15ff0d7c New changeset 426f7a2b1826 by Ezio Melotti in branch 'default': #1745761, #755670, #13357, #12629, #1200313: merge with 3.2. http://hg.python.org/cpython/rev/426f7a2b1826 |
|||
| msg147621 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2011年11月14日 17:16 | |
There was actually a bug with entities in unquoted attribute values. I fixed it and added tests for all the cases (quoted and unquoted). |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:11 | admin | set | github: 41975 |
| 2011年11月14日 17:16:53 | ezio.melotti | set | messages:
+ msg147621 versions: + Python 2.7, Python 3.3 |
| 2011年11月14日 16:57:15 | python-dev | set | nosy:
+ python-dev messages: + msg147614 |
| 2011年11月08日 01:11:30 | ezio.melotti | set | status: open -> closed assignee: fdrake -> ezio.melotti nosy: + ezio.melotti messages: + msg147268 resolution: out of date stage: test needed -> resolved |
| 2010年08月21日 14:33:38 | BreamoreBoy | set | versions: + Python 3.2, - Python 2.7 |
| 2009年02月16日 01:01:58 | ajaksu2 | set | nosy:
+ ajaksu2 stage: test needed type: enhancement messages: + msg82199 versions: + Python 2.7 |
| 2005年05月12日 02:30:55 | jhylton | create | |