summaryrefslogtreecommitdiff
path: root/sphinx/htmlhelp.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-05-02 09:52:34 +0000
committerGeorg Brandl <georg@python.org>2008-05-02 09:52:34 +0000
commit4d6f1f1a5ceaa75a0f2c37db44767618be067e50 (patch)
treeaa5ece702cb95816f10d3bc0b67510c5c9e6ed72 /sphinx/htmlhelp.py
parent7ad49d5756901a1e47f79fd9ec15e3f85cc582ce (diff)
downloadsphinx-git-4d6f1f1a5ceaa75a0f2c37db44767618be067e50.tar.gz
Encode non-ASCII as HTML entities in HTML help files.
Diffstat (limited to 'sphinx/htmlhelp.py')
-rw-r--r--sphinx/htmlhelp.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/sphinx/htmlhelp.py b/sphinx/htmlhelp.py
index 7ad6b2e70..dfdba9c68 100644
--- a/sphinx/htmlhelp.py
+++ b/sphinx/htmlhelp.py
@@ -158,8 +158,8 @@ def build_hhx(builder, outdir, outname):
for subnode in node:
write_toc(subnode, ullevel)
elif isinstance(node, nodes.reference):
- f.write(object_sitemap % (cgi.escape(node.astext()),
- node['refuri']))
+ item = object_sitemap % (cgi.escape(node.astext()), node['refuri'])
+ f.write(item.encode('ascii', 'xmlcharrefreplace'))
elif isinstance(node, nodes.bullet_list):
if ullevel != 0:
f.write('<UL>\n')
@@ -185,7 +185,8 @@ def build_hhx(builder, outdir, outname):
def write_index(title, refs, subitems):
if refs:
f.write('<LI> ')
- f.write(object_sitemap % (cgi.escape(title), refs[0]))
+ item = object_sitemap % (cgi.escape(title), refs[0])
+ f.write(item.encode('ascii', 'xmlcharrefreplace'))
for ref in refs[1:]:
f.write(object_sitemap % ('[Link]', ref))
if subitems: