Ticket #2910: markup.2.diff

File markup.2.diff, 910 bytes (added by waylan@…, 18 years ago)

markup.diff in proper format

  • markup.py

     
    2929    else:
    3030        return textile.textile(value, encoding=settings.DEFAULT_CHARSET, output=settings.DEFAULT_CHARSET)
    3131
    32 def markdown(value):
     32def markdown(value, arg = ''):
    3333    try:
    3434        import markdown
    3535    except ImportError:
     
    3737            raise template.TemplateSyntaxError, "Error in {% markdown %} filter: The Python markdown library isn't installed."
    3838        return value
    3939    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)
    4147
    4248def restructuredtext(value):
    4349    try:
Back to Top