improve link detection (enclosed in braces)
This commit is contained in:
parent
a445d1f6cd
commit
c6fe7356bf
1 changed files with 2 additions and 1 deletions
|
@ -81,7 +81,7 @@ class ContentSubmission(sqlobject.SQLObject):
|
|||
short_name = url.split("/")[2]
|
||||
return """%s<a href="%s">%s</a>%s""" % (prefix, url, short_name, suffix)
|
||||
# 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()
|
||||
# the markup is now marked as "safe" -> genshi will output it literally
|
||||
return markup
|
||||
|
@ -596,6 +596,7 @@ def render_poll_admin(poll, add_related, del_related):
|
|||
return render("poll_admin_details.html", **value_dict)
|
||||
|
||||
@bobo.query('/:poll_hash')
|
||||
@bobo.query('/:poll_hash/')
|
||||
def show_one_poll(poll_hash=None, add_related=None, del_related=None):
|
||||
value_dict = get_default_values()
|
||||
poll_id = get_poll_id(poll_hash)
|
||||
|
|
Loading…
Reference in a new issue