From 0f02092a7a3b223023d97f1f1117d142f264ed2e Mon Sep 17 00:00:00 2001 From: tschmidt-dev Date: Thu, 24 Jan 2013 15:35:03 -0800 Subject: [PATCH] added MARKDOWN_SAFE_MODE setting --- wiki/conf/settings.py | 1 + wiki/core/__init__.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wiki/conf/settings.py b/wiki/conf/settings.py index ce0c5216..74302116 100644 --- a/wiki/conf/settings.py +++ b/wiki/conf/settings.py @@ -14,6 +14,7 @@ WIKI_LANGUAGE = 'markdown' EDITOR = getattr( django_settings, 'WIKI_EDITOR', 'wiki.editors.markitup.MarkItUp' ) MARKDOWN_EXTENSIONS = getattr( django_settings, 'WIKI_MARKDOWN_EXTENSIONS', ['extra', 'toc'] ) +MARKDOWN_SAFE_MODE = getattr( django_settings, 'WIKI_MARKDOWN_SAFE_MODE', 'remove' ) # This slug is used in URLPath if an article has been deleted. The children of the # URLPath of that article are moved to lost and found. They keep their permissions diff --git a/wiki/core/__init__.py b/wiki/core/__init__.py index e0bb3453..bc0e532e 100644 --- a/wiki/core/__init__.py +++ b/wiki/core/__init__.py @@ -1,9 +1,12 @@ import markdown +from wiki.conf import settings + + class ArticleMarkdown(markdown.Markdown): def __init__(self, article, *args, **kwargs): - kwargs['safe_mode'] = "remove" + kwargs['safe_mode'] = settings.MARKDOWN_SAFE_MODE markdown.Markdown.__init__(self, *args, **kwargs) self.article = article -- 2.45.2