bodhi/templates/show.kid | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
New commits: commit bea1eb711c2f9fe985fbf98b861c163e499e566e Author: Mathieu Bridon bochecha@fedoraproject.org Date: Fri Mar 12 21:44:55 2010 +0100
Ticket #395: URLs containing underscores in descriptions break when shown on web interface
Underscores are a fairly common character in updates descriptions, especially in URLs. Let's ask markdown2 to ignore them.
diff --git a/bodhi/templates/show.kid b/bodhi/templates/show.kid index 2ae0995..82d1868 100644 --- a/bodhi/templates/show.kid +++ b/bodhi/templates/show.kid @@ -39,7 +39,11 @@ release = util.link(update.release.long_name, '/' + update.release.name) submitter = util.link(update.submitter, '/user/' + update.submitter)
reg = re.compile(r'(^[-*] .*(?:\n[-*] .*)*)', re.MULTILINE) -notes = markdown(reg.sub(r'\n\1\n', escape(update.notes))) + +markdown_extras = [ + "code-friendly" # Disable _ and __ for em and strong. Underscores is a frequent character in URLs, let's not break them. + ] +notes = markdown(reg.sub(r'\n\1\n', escape(update.notes)), extras=markdown_extras)
if update.karma < 0: karma = -1 elif update.karma > 0: karma = 1