Ticket #6526: 6526-mardown-with-options-for-safe-mode.diff

File 6526-mardown-with-options-for-safe-mode.diff, 947 bytes (added by Timothée Peignier <tim@…>, 16 years ago)

Markdown filter accepting options for safe_mode

  • django/contrib/markup/templatetags/markup.py

     
    6060        # to fully support extensions before 1.6b was the shortlived 1.6a.
    6161        if hasattr(markdown, 'version'):
    6262            extensions = [e for e in arg.split(",") if e]
    63             if len(extensions) > 0 and extensions[0] == "safe":
     63            if len(extensions) > 0 and extensions[0] in ('safe','replace','remove','escape'):
     64                # using True for compatibility reason
     65                if extensions[0] = 'safe':
     66                    safe_mode = True
     67                else:
     68                    safe_mode = extensions[0]
    6469                extensions = extensions[1:]
    65                 safe_mode = True
    6670            else:
    6771                safe_mode = False
    6872
Back to Top