From 645aa02c049fbd0c02fd72ce330bed8d7684be64 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 8 Jun 2012 14:18:41 -0400 Subject: Bang on the scripts until the W3C validator is happy Apparently our output was trying to be XHTML 1.0 transitional. Now, it actually is. --- BibTeX.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'BibTeX.py') diff --git a/BibTeX.py b/BibTeX.py index bfe499e..110e5ff 100644 --- a/BibTeX.py +++ b/BibTeX.py @@ -34,9 +34,10 @@ WWW_FIELDS = [ 'www_section', 'www_important', 'www_remarks', def url_untranslate(s): """Change a BibTeX key into a string suitable for use in a URL.""" - s = re.sub(r'([%<>, _])', + s = re.sub(r'([%<>`#, &_\';])', lambda m: "_%02x"%ord(m.group(1)), s) + s = s.replace("/",":") return s class ParseError(Exception): @@ -328,6 +329,7 @@ class BibTeXEntry: if np: d.append("%%%%% "+("ERROR: Non-ASCII characters: '%r'\n"%np)) d.append(" ") + v = v.replace("&", "&") if invStrings.has_key(v): s = "%s = %s,\n" %(f, invStrings[v]) else: @@ -572,6 +574,7 @@ class BibTeXEntry: url = self.get(key) if not url: continue url = unTeXescapeURL(url) + url = url.replace('&', '&') availability.append('%s' %(url,name)) if availability: @@ -603,7 +606,7 @@ class BibTeXEntry: res.append("

") if self.get('www_remarks'): - res.append("

%s"%htmlize( + res.append("

%s

"%htmlize( self['www_remarks'])) if imp or draft: -- cgit v1.2.3-70-g09d2