summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libhtmllib.tex
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2004-09-10 01:20:21 (GMT)
committerFred Drake <fdrake@acm.org>2004-09-10 01:20:21 (GMT)
commit961c2882a920f137543585175db9957bf48223f3 (patch)
treedf8ee0408a4d7890b09a51611012ab746bda48e7 /Doc/lib/libhtmllib.tex
parenta2544ee7f0ecbab945d1bb6bb8de6a72c71768ed (diff)
downloadcpython-961c2882a920f137543585175db9957bf48223f3.zip
cpython-961c2882a920f137543585175db9957bf48223f3.tar.gz
cpython-961c2882a920f137543585175db9957bf48223f3.tar.bz2
document the exceptions raised by sgmllib, htmllib, and HTMLParser
Diffstat (limited to 'Doc/lib/libhtmllib.tex')
-rw-r--r--Doc/lib/libhtmllib.tex15
1 files changed, 11 insertions, 4 deletions
diff --git a/Doc/lib/libhtmllib.tex b/Doc/lib/libhtmllib.tex
index 1cddd0a..a84dd85 100644
--- a/Doc/lib/libhtmllib.tex
+++ b/Doc/lib/libhtmllib.tex
@@ -35,8 +35,8 @@ The interface to feed data to an instance is through the \method{feed()}
method, which takes a string argument. This can be called with as
little or as much text at a time as desired; \samp{p.feed(a);
p.feed(b)} has the same effect as \samp{p.feed(a+b)}. When the data
-contains complete HTML tags, these are processed immediately;
-incomplete elements are saved in a buffer. To force processing of all
+contains complete HTML markup constructs, these are processed immediately;
+incomplete constructs are saved in a buffer. To force processing of all
unprocessed data, call the \method{close()} method.
For example, to parse the entire contents of a file, use:
@@ -60,7 +60,7 @@ should define the \method{do_\var{tag}()} method.
\end{itemize}
-The module defines a single class:
+The module defines a parser class and an exception:
\begin{classdesc}{HTMLParser}{formatter}
This is the basic HTML parser class. It supports all entity names
@@ -68,6 +68,12 @@ required by the XHTML 1.0 Recommendation (\url{http://www.w3.org/TR/xhtml1}).
It also defines handlers for all HTML 2.0 and many HTML 3.0 and 3.2 elements.
\end{classdesc}
+\begin{excdesc}{HTMLParseError}
+Exception raised by the \class{HTMLParser} class when it encounters an
+error while parsing.
+\versionadded{2.4}
+\end{excdesc}
+
\begin{seealso}
\seemodule{formatter}{Interface definition for transforming an
@@ -118,7 +124,8 @@ implementation adds a textual footnote marker using an index into the
list of hyperlinks created by \method{anchor_bgn()}.
\end{methoddesc}
-\begin{methoddesc}{handle_image}{source, alt\optional{, ismap\optional{, align\optional{, width\optional{, height}}}}}
+\begin{methoddesc}{handle_image}{source, alt\optional{, ismap\optional{,
+ align\optional{, width\optional{, height}}}}}
This method is called to handle images. The default implementation
simply passes the \var{alt} value to the \method{handle_data()}
method.