| 55 | the handle_starttag and handle_endtags methods, might have to also. |
| 56 | """ |
| 57 | def __init__(self, text): |
| 58 | HTMLParser.__init__(self, convert_charrefs=True) |
| 59 | self.text = text # Text widget we're rendering into. |
| 60 | self.tags = '' # Current block level text tags to apply. |
| 61 | self.chartags = '' # Current character level text tags. |
| 62 | self.hdrlink = False # Exclude html header links. |
| 63 | self.level = 0 # Track indentation level. |
| 64 | self.pre = False # Displaying preformatted text? |
| 65 | self.hprefix = '' # Heading prefix (like '25.5'?) to remove. |
| 66 | self.nested_dl = False # In a nested <dl>? |
| 67 | self.simplelist = False # In a simple list (no double spacing)? |
| 68 | self.toc = [] # Pair headers with text indexes for toc. |
| 69 | self.header = '' # Text within header tags for toc. |
| 70 | self.prevtag = None # Previous tag info (opener?, tag). |
| 71 | |
| 72 | def indent(self, amt=1): |
| 73 | "Change indent (+1, 0, -1) and tags." |