diff options
| author | georg.brandl <devnull@localhost> | 2008-05-02 09:52:34 +0000 |
|---|---|---|
| committer | georg.brandl <devnull@localhost> | 2008-05-02 09:52:34 +0000 |
| commit | c19961d9a3982a25d5530308986a5643b2916dff (patch) | |
| tree | aa5ece702cb95816f10d3bc0b67510c5c9e6ed72 /sphinx/htmlhelp.py | |
| parent | 41085a743f9cd2703fcb88847f9816d7aac3e43b (diff) | |
| download | sphinx-c19961d9a3982a25d5530308986a5643b2916dff.tar.gz | |
Encode non-ASCII as HTML entities in HTML help files.
Diffstat (limited to 'sphinx/htmlhelp.py')
| -rw-r--r-- | sphinx/htmlhelp.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sphinx/htmlhelp.py b/sphinx/htmlhelp.py index 7ad6b2e7..dfdba9c6 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: |
