diff options
author | Tim Peters <tim.peters@gmail.com> | 2002-04-21 04:44:11 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2002-04-21 04:44:11 (GMT) |
commit | 4a0db06edf1e1be71d27c682f7bc0fb4040a5300 (patch) | |
tree | 4b1ac47087f619f11f5d6efc7398da2c61ff0921 | |
parent | 7e3d961fc15e3e7fd5846e31bdfd3fc8df19edec (diff) | |
download | cpython-4a0db06edf1e1be71d27c682f7bc0fb4040a5300.zip cpython-4a0db06edf1e1be71d27c682f7bc0fb4040a5300.tar.gz cpython-4a0db06edf1e1be71d27c682f7bc0fb4040a5300.tar.bz2 |
Hack around the "2.1.6 Blank lines" bug in a way that the TOC still
displays a recognizable section title (there are extra blanks at the
end of it now, due to the nested anchor, but that's fine).
-rw-r--r-- | Doc/tools/prechm.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Doc/tools/prechm.py b/Doc/tools/prechm.py index 2891a89..2eb10e2 100644 --- a/Doc/tools/prechm.py +++ b/Doc/tools/prechm.py @@ -274,18 +274,20 @@ class HelpHtmlParser(HTMLParser): def anchor_bgn(self, href, name, type): if self.proc: - self.saved_clear() - self.hrefstack.append(href) - - def anchor_end(self): - if self.proc: - title = cgi.escape(self.saved_get(), True) - path = self.path + '/' + self.hrefstack.pop() # XXX See SF bug <http://www.python.org/sf/546579>. - # XXX index.html for the 2.2 language reference manual contains + # XXX index.html for the 2.2.1 language reference manual contains # XXX nested <a></a> tags in the entry for the section on blank # XXX lines. We want to ignore the nested part completely. if len(self.hrefstack) == 0: + self.saved_clear() + self.hrefstack.append(href) + + def anchor_end(self): + if self.proc: + # XXX See XXX above. + if self.hrefstack: + title = cgi.escape(self.saved_get(), True) + path = self.path + '/' + self.hrefstack.pop() self.tab(object_sitemap % (title, path)) def start_dl(self, atr_val): |