Mercurial > public > sg101
comparison smiley/__init__.py @ 792:7429c98c8ece
Issue #71: use relative URLs for smileys on the web and absolute for RSS.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Mon, 26 May 2014 14:59:55 -0500 |
parents | 0729c73d5761 |
children | 98d2388b6bb2 |
comparison
equal
deleted
inserted
replaced
791:0ca691cccf8d | 792:7429c98c8ece |
---|---|
41 class SmilifyMarkdown(object): | 41 class SmilifyMarkdown(object): |
42 """ | 42 """ |
43 A class to "smilify" text by replacing text with Markdown image syntax for | 43 A class to "smilify" text by replacing text with Markdown image syntax for |
44 smiley images. | 44 smiley images. |
45 """ | 45 """ |
46 def __init__(self): | 46 def __init__(self, relative_urls=True): |
47 self.regexes = Smiley.objects.get_smiley_regexes() | 47 self.regexes = Smiley.objects.get_smiley_regexes( |
48 relative_urls=relative_urls) | |
48 | 49 |
49 def convert(self, s): | 50 def convert(self, s): |
50 """ | 51 """ |
51 Returns a string copy of the input s that has the smiley codes replaced | 52 Returns a string copy of the input s that has the smiley codes replaced |
52 with Markdown for smiley images. | 53 with Markdown for smiley images. |