Ticket #2910: markup.2.diff
File markup.2.diff, 910 bytes (added by , 18 years ago) |
---|
-
markup.py
29 29 else: 30 30 return textile.textile(value, encoding=settings.DEFAULT_CHARSET, output=settings.DEFAULT_CHARSET) 31 31 32 def markdown(value ):32 def markdown(value, arg = ''): 33 33 try: 34 34 import markdown 35 35 except ImportError: … … 37 37 raise template.TemplateSyntaxError, "Error in {% markdown %} filter: The Python markdown library isn't installed." 38 38 return value 39 39 else: 40 return markdown.markdown(value) 40 extensions = arg.split(",") 41 if len(extensions) > 0 and extensions[0] == "safe" : 42 extensions = extensions[1:] 43 safe_mode = True 44 else : 45 safe_mode = False 46 return markdown.markdown(value, extensions, safe_mode = safe_mode) 41 47 42 48 def restructuredtext(value): 43 49 try: