Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-wiki
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-wiki
Commits
90703582
Commit
90703582
authored
Feb 03, 2013
by
benjaoming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error in macros removing unknown tags from stack and prettify styling
parent
ff9ad262
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
16 deletions
+15
-16
wiki/plugins/macros/markdown_extensions.py
+7
-8
wiki/plugins/macros/templates/wiki/plugins/macros/article_list.html
+6
-7
wiki/templates/wiki/base.html
+2
-1
No files found.
wiki/plugins/macros/markdown_extensions.py
View file @
90703582
...
...
@@ -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
...
...
wiki/plugins/macros/templates/wiki/plugins/macros/article_list.html
View file @
90703582
{% 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 %}
wiki/templates/wiki/base.html
View file @
90703582
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment