[Python-checkins] r43532 - in python/trunk: Doc/lib/libsgmllib.tex Lib/sgmllib.py Lib/test/test_sgmllib.py Misc/NEWS (original) (raw)

georg.brandl python-checkins at python.org
Sat Apr 1 10:35:20 CEST 2006


Author: georg.brandl Date: Sat Apr 1 10:35:18 2006 New Revision: 43532

Modified: python/trunk/Doc/lib/libsgmllib.tex python/trunk/Lib/sgmllib.py python/trunk/Lib/test/test_sgmllib.py python/trunk/Misc/NEWS Log: patch #1462498: handle entityrefs in attribute values.

Modified: python/trunk/Doc/lib/libsgmllib.tex

--- python/trunk/Doc/lib/libsgmllib.tex (original) +++ python/trunk/Doc/lib/libsgmllib.tex Sat Apr 1 10:35:18 2006 @@ -95,12 +95,15 @@ should be used to support semantic interpretation of the start tag. The \var{attributes} argument is a list of \code{(\var{name}, \var{value})} pairs containing the attributes found inside the tag's -\code{<>} brackets. The \var{name} has been translated to lower case -and double quotes and backslashes in the \var{value} have been interpreted. +\code{<>} brackets. The \var{name} has been translated to lower case. +Double quotes and backslashes in the \var{value} have been interpreted, +as well as known entity and character references. For instance, for the tag \code{<A HREF="http://www.cwi.nl/">}, this method would be called as \samp{unknown_starttag('a', [('href', 'http://www.cwi.nl/')])}. The base implementation simply calls \var{method} with \var{attributes} as the only argument. +\versionadded[Handling of entity and character references within

\end{methoddesc}

\begin{methoddesc}{handle_endtag}{tag, method}

Modified: python/trunk/Lib/sgmllib.py

--- python/trunk/Lib/sgmllib.py (original) +++ python/trunk/Lib/sgmllib.py Sat Apr 1 10:35:18 2006 @@ -269,9 +269,37 @@ attrname, rest, attrvalue = match.group(1, 2, 3) if not rest: attrvalue = attrname

Modified: python/trunk/Lib/test/test_sgmllib.py

--- python/trunk/Lib/test/test_sgmllib.py (original) +++ python/trunk/Lib/test/test_sgmllib.py Sat Apr 1 10:35:18 2006 @@ -214,6 +214,20 @@ ("starttag", "e", [("a", "rgb(1,2,3)")]), ])

Modified: python/trunk/Misc/NEWS

--- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Apr 1 10:35:18 2006 @@ -489,6 +489,9 @@ Library

+- Patch #1462498: sgmllib now handles entity and character references



More information about the Python-checkins mailing list