Only quote ampersand, that's the one that the HTML validator bitches about.
authorMagnus Hagander <magnus@hagander.net>
Tue, 28 Oct 2008 16:17:56 +0000 (16:17 +0000)
committerMagnus Hagander <magnus@hagander.net>
Tue, 28 Oct 2008 16:17:56 +0000 (16:17 +0000)
Specifically don't quote the whole URL, because it's going into HTML and not
into a different URL.

Per notice from Gevik

planethtml.py

index 89120860f528b37192cc5b3253b1870075c7da54..9dfb55831e2e6b652e6e573db2e7f7838aa50c29 100644 (file)
@@ -11,10 +11,10 @@ import datetime
 import urllib
 
 # Yes, a global function (!)
+# Hmm. We only quote the ampersand here, since it's a HTML escape that
+# shows up in URLs quote often.
 def quoteurl(str):
-       if str=="": return ""
-       p = str.split(":",2)
-       return p[0] + ":" + urllib.quote(p[1])
+       return str.replace('&','&amp;')
 
 class PlanetPost:
        def __init__(self, guid,link,dat,title,author,blogurl,txt):