class HTMLParser(SGMLParser):
- def __init__(self, formatter):
- SGMLParser.__init__(self)
+ def __init__(self, formatter, verbose=0):
+ SGMLParser.__init__(self, verbose)
self.formatter = formatter
self.savedata = None
self.isindex = 0
# --- Hook for images; should probably be overridden
- def handle_image(self, src, alt):
+ def handle_image(self, src, alt, *args):
self.handle_data(alt)
# --------- Top level elememts
alt = '(image)'
ismap = ''
src = ''
+ width = 0
+ height = 0
for attrname, value in attrs:
if attrname == 'align':
align = value
ismap = value
if attrname == 'src':
src = value
- self.handle_image(src, alt)
+ if attrname == 'width':
+ try: width = string.atoi(value)
+ except: pass
+ if attrname == 'height':
+ try: height = string.atoi(value)
+ except: pass
+ self.handle_image(src, alt, ismap, align, width, height)
# --- Really Old Unofficial Deprecated Stuff