[gimp-web] Keep & in href attributes



commit 866faa4fe36d806f23e1bb0f58d48d2b81b4f827
Author: Michael Schumacher <schumaml gmx de>
Date:   Fri Apr 19 11:12:45 2013 +0200

    Keep &amp; in href attributes
    
    Since Python 2.6, the HTMLParser replaces entities automatically, this
    causes a lot of pages to become invalid (e.g. all links to Bugzilla
    queries). This changes uses cgi.escape to reverse that.

 programmatic/tools/rewrite_attrs.py | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/programmatic/tools/rewrite_attrs.py b/programmatic/tools/rewrite_attrs.py
index ae29ea0..89eb7f9 100755
--- a/programmatic/tools/rewrite_attrs.py
+++ b/programmatic/tools/rewrite_attrs.py
@@ -51,6 +51,7 @@ import os
 import re
 import HTMLParser
 import getopt
+import cgi
 
 sys.path = ['${SRCDIR}'] + sys.path
 
@@ -69,6 +70,9 @@ def substitute(a, v):
       return (d[v])
     pass
 
+  if a == 'href' :
+    v = cgi.escape(v)
+
   return ({a: v})
 
     


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]