diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/notes/models.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/notes/models.py b/app/notes/models.py index 40323b1..464ea6c 100644 --- a/app/notes/models.py +++ b/app/notes/models.py @@ -79,10 +79,12 @@ class Note(models.Model): def get_next_published(self): return self.get_next_by_date_created() - def link_twitter_names(self): - opts = {'username_include_symbol': True} + def render(self): from twitter_text.autolink import Autolink - return Autolink(self.body_html).auto_link_usernames_or_lists(opts) + opts = {'username_include_symbol': True} + temp = " ".join(self.body_markdown.split("|")) + html = markdown.markdown(urlize(temp, 45), extensions=['extra'], safe_mode=False) + return Autolink(html).auto_link_usernames_or_lists(opts) def save(self): self.body_html = markdown.markdown(urlize(self.body_markdown, 45), extensions=['extra'], safe_mode=False) |