Commit 90703582 by benjaoming

Fix error in macros removing unknown tags from stack and prettify styling

parent ff9ad262
......@@ -30,14 +30,13 @@ class MacroPreprocessor(markdown.preprocessors.Preprocessor):
m = MACRO_RE.match(line)
if m:
macro = m.group('macro').strip()
if not macro in MacroPreprocessor.allowed_methods:
continue
kwargs = m.group('kwargs')
if kwargs:
kwargs = eval('{' + KWARG_RE.sub(r'"\1":"\2",', kwargs) + '}')
line = getattr(self, macro)(**kwargs)
else:
line = getattr(self, macro)()
if macro in MacroPreprocessor.allowed_methods:
kwargs = m.group('kwargs')
if kwargs:
kwargs = eval('{' + KWARG_RE.sub(r'"\1":"\2",', kwargs) + '}')
line = getattr(self, macro)(**kwargs)
else:
line = getattr(self, macro)()
if not line is None:
new_text.append(line)
return new_text
......
{% load i18n wiki_macro_tags %}
{% if article_children %}
<div class="well wiki-article-list">
<h3>{% trans "Articles" %}</h3>
<br/>
{% for child in article_children %}
{% article_list child depth %}
{% endfor %}
</div>
<h3>{% trans "Articles" %}</h3>
<div class="article-list">
{% for child in article_children %}
{% article_list child depth %}
{% endfor %}
</div>
{% endif %}
......@@ -40,7 +40,8 @@
#edit_sidebar .accordion {margin-bottom: 5px;}
.wiki-article div.toc {
.wiki-article div.toc,
.wiki-article div.article-list {
margin: 10px 0;
background: #f9f9f9;
padding: 10px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment