Permalink
Browse files

two small bugfixes

 - mooneyspace.com needs real ampersand, not %26
 - do not have an empty tag in every loaded list
  • Loading branch information...
1 parent 58f6694 commit 89057619b7cf0f30d5101077d95f1d99da2ad67e @zaitcev committed Aug 1, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 slasti/tagbase.py
View
@@ -217,7 +217,10 @@ def __init__(self, base, fromtag, marklist, markindex):
f.close()
return
- self.tags = string.split(string.rstrip(s, "\r\n"), " ")
+ s = string.rstrip(s, "\r\n")
+ # Stripping spaces prevents emply tags coming out of split().
+ s = string.strip(s, " ")
+ self.tags = string.split(s, " ")
f.close()
@@ -243,10 +246,11 @@ def html(self):
# The urllib.quote_plus does not work as expected: it escapes ':' and
# such too, so "http://host" turns into "http%3A//host", and this
# corrupts the link. So, hand-roll quotes and XML escapes for now.
+ # N.B. Mooneyspace.com hates when we reaplace '&' with %26, so don't.
## url = urllib.quote_plus(self.url)
url = self.url
url = url.replace('"', '%22')
- url = url.replace('&', '%26')
+ # url = url.replace('&', '%26')
url = url.replace('<', '%3C')
url = url.replace('>', '%3E')

0 comments on commit 8905761

Please sign in to comment.