mirror of
https://github.com/python/cpython.git
synced 2025-12-08 02:08:20 +00:00
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).
This commit is contained in:
parent
7e3d961fc1
commit
4a0db06edf
1 changed files with 10 additions and 8 deletions
|
|
@ -274,18 +274,20 @@ class HelpHtmlParser(HTMLParser):
|
||||||
|
|
||||||
def anchor_bgn(self, href, name, type):
|
def anchor_bgn(self, href, name, type):
|
||||||
if self.proc:
|
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 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 nested <a></a> tags in the entry for the section on blank
|
||||||
# XXX lines. We want to ignore the nested part completely.
|
# XXX lines. We want to ignore the nested part completely.
|
||||||
if len(self.hrefstack) == 0:
|
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))
|
self.tab(object_sitemap % (title, path))
|
||||||
|
|
||||||
def start_dl(self, atr_val):
|
def start_dl(self, atr_val):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue