aboutsummaryrefslogtreecommitdiffstats
path: root/BibTeX.py
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-11-23 22:44:05 +0000
committerNick Mathewson <nickm@torproject.org>2004-11-23 22:44:05 +0000
commit3926ef7670063de5684d68bd9f59f84dd38424cc (patch)
tree4196011930c3223791883b3d0647f754f7ec1a3a /BibTeX.py
parent7e92fc0b861c7551fb05898c15bd615dbbb50e46 (diff)
downloadanonbib-3926ef7670063de5684d68bd9f59f84dd38424cc.tar.gz
apply patch from goodell: fix ligatures and allow soft hyphens in URLs
svn:r122
Diffstat (limited to 'BibTeX.py')
-rw-r--r--BibTeX.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/BibTeX.py b/BibTeX.py
index 5978ccd..2062988 100644
--- a/BibTeX.py
+++ b/BibTeX.py
@@ -564,6 +564,7 @@ class BibTeXEntry:
def unTeXescapeURL(s):
"""Turn a URL as formatted in TeX into a real URL."""
s = s.replace("\\_", "_")
+ s = s.replace("\\-", "")
s = s.replace("\{}", "")
s = s.replace("{}", "")
return s
@@ -610,8 +611,8 @@ def htmlize(s):
s = RE_LONE_AMP.sub(lambda m: "&amp;%s" % m.group(1), s)
s = RE_LONE_I.sub(lambda m: "i%s" % m.group(1), s)
s = RE_ACCENT.sub(_unaccent, s)
- s = RE_LIGATURE.sub(_unlig_html, s);
s = unTeXescapeURL(s)
+ s = RE_LIGATURE.sub(_unlig_html, s);
s = RE_TEX_CMD.sub("", s)
s = s.translate(ALLCHARS, "{}")
s = RE_PAGE_SPAN.sub(lambda m: "%s-%s"%(m.groups()), s)