diff options
| author | Nick Mathewson <nickm@torproject.org> | 2012-06-08 14:18:41 -0400 |
|---|---|---|
| committer | Nick Mathewson <nickm@torproject.org> | 2012-06-08 14:18:41 -0400 |
| commit | 645aa02c049fbd0c02fd72ce330bed8d7684be64 (patch) | |
| tree | 58eea7aae4953dc93ddd0925ed5026aab3eecd62 /BibTeX.py | |
| parent | 6bf41292c1807437ec7472f7957227f6736109b0 (diff) | |
| download | anonbib-645aa02c049fbd0c02fd72ce330bed8d7684be64.tar.gz | |
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.
Diffstat (limited to 'BibTeX.py')
| -rw-r--r-- | BibTeX.py | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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('<a href="%s">%s</a>' %(url,name)) if availability: @@ -603,7 +606,7 @@ class BibTeXEntry: res.append("</p>") if self.get('www_remarks'): - res.append("<p class='remarks'>%s</span>"%htmlize( + res.append("<p class='remarks'>%s</p>"%htmlize( self['www_remarks'])) if imp or draft: |
