From d19d3d2bd70e3192bc84ba605bd3df02361ea7de Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Thu, 11 Oct 2012 21:45:22 -0400 Subject: [PATCH] Hack around Markdown parser failures for now (imported from commit dba079d444d40e36c91508b86b243bdc805c6222) --- zephyr/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zephyr/models.py b/zephyr/models.py index c629a7cb90..09ed5e2da0 100644 --- a/zephyr/models.py +++ b/zephyr/models.py @@ -223,7 +223,11 @@ class Message(models.Model): content = self.heading_regex.sub(r' \1', self.content) with_links = self.link_regex.sub(linkify, content) - return md_engine.convert(with_links) + try: + return md_engine.convert(with_links) + except: + # FIXME: Do something more reasonable here! + return '

[Humbug note: Sorry, we could not understand the formatting of your message]

' @cache_with_key(lambda self, apply_markdown: 'message_dict:%d:%d' % (self.id, apply_markdown)) def to_dict(self, apply_markdown):