comparison gpp/core/markup.py @ 356:f54bf3b3bece

Fix 180; Add strikethrough capability to markdown via an extension. Also control in SVN the extensions we are using.
author Brian Neal <bgneal@gmail.com>
date Fri, 04 Mar 2011 02:10:37 +0000
parents 6a686ffb6609
children
comparison
equal deleted inserted replaced
355:a1e3724f0799 356:f54bf3b3bece
17 def __init__(self, safe_mode='escape'): 17 def __init__(self, safe_mode='escape'):
18 # Unicode support only in markdown v1.7 or above. Version_info 18 # Unicode support only in markdown v1.7 or above. Version_info
19 # exists only in markdown v1.6.2rc-2 or above. 19 # exists only in markdown v1.6.2rc-2 or above.
20 self.unicode_support = getattr(_markdown, "version_info", None) >= (1, 7) 20 self.unicode_support = getattr(_markdown, "version_info", None) >= (1, 7)
21 self.md = _markdown.Markdown(safe_mode=safe_mode, 21 self.md = _markdown.Markdown(safe_mode=safe_mode,
22 extensions=['urlize', 'nl2br']) 22 extensions=['urlize', 'nl2br', 'del'])
23 23
24 def convert(self, s): 24 def convert(self, s):
25 if self.unicode_support: 25 if self.unicode_support:
26 return self.md.convert(force_unicode(s)) 26 return self.md.convert(force_unicode(s))
27 else: 27 else: