From 4d34e70ba15792ce735fcdfd291e22d68f7200bf Mon Sep 17 00:00:00 2001 From: tschmidt-dev Date: Mon, 4 Feb 2013 09:36:01 -0800 Subject: [PATCH] fixed macro arg regex for args longer than 1 character --- wiki/plugins/macros/markdown_extensions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wiki/plugins/macros/markdown_extensions.py b/wiki/plugins/macros/markdown_extensions.py index 75e75e61..c42500c9 100644 --- a/wiki/plugins/macros/markdown_extensions.py +++ b/wiki/plugins/macros/markdown_extensions.py @@ -10,7 +10,7 @@ from django.template import Context re_sq_short = r"'([^'\\]*(?:\\.[^'\\]*)*)'" MACRO_RE = re.compile(r'.*(\[(?P\w+)(?P\s\w+\:.+)*\]).*', re.IGNORECASE) -KWARG_RE = re.compile(r'\s*(?P\w+)(:(?P([^\']|%s)))?' % re_sq_short, re.IGNORECASE) +KWARG_RE = re.compile(r'\s*(?P\w+)(:(?P([^\']+|%s)))?' % re_sq_short, re.IGNORECASE) from wiki.plugins.macros import settings @@ -54,6 +54,7 @@ class MacroPreprocessor(markdown.preprocessors.Preprocessor): value = value.replace(u"\\", u"") value = value.replace(u"¤KEEPME¤", u"\\") kwargs_dict[arg] = value + print kwargs_dict line = getattr(self, macro)(**kwargs_dict) else: line = getattr(self, macro)() @@ -62,6 +63,7 @@ class MacroPreprocessor(markdown.preprocessors.Preprocessor): return new_text def article_list(self, depth=2): + print depth html = render_to_string( "wiki/plugins/macros/article_list.html", Context({ -- 2.45.2