Mercurial > cpython-lru_cache-weakref
comparison Lib/HTMLParser.py @ 17934:e14b41fd2ab2 legacy-trunk
Merge my changes to the offending comment with Guido's changes.
| author | Fred Drake <fdrake@acm.org> |
|---|---|
| date | Wed, 23 May 2001 04:53:44 +0000 |
| parents | ce7f0e380830 |
| children | 00935031b373 |
comparison
equal
deleted
inserted
replaced
| 17933:562176191e60 | 17934:e14b41fd2ab2 |
|---|---|
| 72 result = result + ", column %d" % (self.offset + 1) | 72 result = result + ", column %d" % (self.offset + 1) |
| 73 return result | 73 return result |
| 74 | 74 |
| 75 | 75 |
| 76 # HTML parser class -- find tags and call handler functions. | 76 # HTML parser class -- find tags and call handler functions. |
| 77 # Usage: p = HTMLParser(); p.feed(data); ...; p.close(). | 77 # Usage: |
| 78 # | |
| 79 # p = HTMLParser(); p.feed(data); ...; p.close() | |
| 78 | 80 |
| 79 # Start tags are handled by calling self.handle_starttag() or | 81 # Start tags are handled by calling self.handle_starttag() or |
| 80 # self.handle_startendtag(); end tags by self.handle_endtag(). The | 82 # self.handle_startendtag(); end tags by self.handle_endtag(). The |
| 81 # data between tags is passed to the parser by calling | 83 # data between tags is passed from the parser to the derived class by |
| 82 # self.handle_data() with some data as argument (the data may be split | 84 # calling self.handle_data() with the data as argument (the data may |
| 83 # up in arbitrary chunks). Entity references are passed by calling | 85 # be split up in arbitrary chunks). Entity references are passed by |
| 84 # self.handle_entityref() with the entity reference as argument. | 86 # calling self.handle_entityref() with the entity reference as the |
| 85 # Etc. | 87 # argument. Numeric character references are passed to |
| 88 # self.handle_charref() with the string containing the reference as | |
| 89 # the argument. | |
| 86 | 90 |
| 87 class HTMLParser: | 91 class HTMLParser: |
| 88 | 92 |
| 89 CDATA_CONTENT_ELEMENTS = ("script", "style") | 93 CDATA_CONTENT_ELEMENTS = ("script", "style") |
| 90 | 94 |
