Code

Ticket #6526: 6526-mardown-html-removed-text.diff

File 6526-mardown-html-removed-text.diff, 660 bytes (added by Timothée Peignier <tim@…>, 6 years ago)

Adding settings to customize markdown remove text

Line 
1Index: django/contrib/markup/templatetags/markup.py
2===================================================================
3--- django/contrib/markup/templatetags/markup.py        (revision 8061)
4+++ django/contrib/markup/templatetags/markup.py        (working copy)
5@@ -66,6 +66,9 @@
6             else:
7                 safe_mode = False
8 
9+            if settings.MARKDOWN_HTML_REMOVED_TEXT:
10+                markdown.HTML_REMOVED_TEXT = settings.MARKDOWN_HTML_REMOVED_TEXT
11+
12             # Unicode support only in markdown v1.7 or above. Version_info
13             # exist only in markdown v1.6.2rc-2 or above.
14             if getattr(markdown, "version_info", None) < (1,7):