aboutsummaryrefslogtreecommitdiffstats
path: root/writeHTML.py
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2003-05-20 18:56:27 +0000
committerNick Mathewson <nickm@torproject.org>2003-05-20 18:56:27 +0000
commit88b3048fb362fc83050303a76bf3d4236111f397 (patch)
tree07b778aa1a867ffe75369cd70855deb9081aa250 /writeHTML.py
parent409aac6f781e22b875e018e642b1b2c9a5a1bf31 (diff)
downloadanonbib-88b3048fb362fc83050303a76bf3d4236111f397.tar.gz
A better route to non-breaking section names.
svn:r15
Diffstat (limited to 'writeHTML.py')
-rw-r--r--writeHTML.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/writeHTML.py b/writeHTML.py
index b39348e..c1d6935 100644
--- a/writeHTML.py
+++ b/writeHTML.py
@@ -19,6 +19,8 @@ def writeBody(f, sections, section_urls):
section_urls: map from sectionname to external url'''
for s, entries in sections:
u = section_urls.get(s)
+ s = re.sub(r'\s+', ' ', s.strip())
+ s = s.replace(" ", "&nbsp;")
if u:
print >>f, ('<h3><a name="%s"><a href="%s">%s</a></a></h3>'%(
(BibTeX.url_untranslate(s), u, s)))
@@ -38,8 +40,10 @@ def writeHTML(f, sections, sectionType, fieldName, choices, section_urls={}):
#
secStr = []
for s, _ in sections:
+ hts = re.sub(r'\s+', ' ', s.strip())
+ hts = s.replace(" ", "&nbsp;")
secStr.append("<p class='l2'><a href='#%s'>%s</a></p>\n"%
- ((BibTeX.url_untranslate(s),s)))
+ ((BibTeX.url_untranslate(s),hts)))
secStr = "".join(secStr)
#