allow "~" in links
This commit is contained in:
parent
307957e26a
commit
e7bbc91974
1 changed files with 1 additions and 1 deletions
|
@ -82,7 +82,7 @@ class ContentSubmission(sqlobject.SQLObject):
|
||||||
short_name = url.split("/")[2]
|
short_name = url.split("/")[2]
|
||||||
return """%s<a href="%s">%s</a>%s""" % (prefix, url, short_name, suffix)
|
return """%s<a href="%s">%s</a>%s""" % (prefix, url, short_name, suffix)
|
||||||
# surround all urls with html markup
|
# surround all urls with html markup
|
||||||
mark_links = re.sub(r"(\A|\s|\()(https?://[\w/\?\.\#=;,_\-]*)(\)|\s|\Z)", get_link_markup, self.content)
|
mark_links = re.sub(r"(\A|\s|\()(https?://[\w/\?\.\#=;,_\-\~]*)(\)|\s|\Z)", get_link_markup, self.content)
|
||||||
markup = genshi.input.HTML(mark_links) | genshi.filters.HTMLSanitizer()
|
markup = genshi.input.HTML(mark_links) | genshi.filters.HTMLSanitizer()
|
||||||
# the markup is now marked as "safe" -> genshi will output it literally
|
# the markup is now marked as "safe" -> genshi will output it literally
|
||||||
return markup
|
return markup
|
||||||
|
|
Loading…
Reference in a new issue