Added the possibility to pass a macro filter to the render methods
This commit is contained in:
parent
8a2da2b843
commit
2abea3c4ae
10
__init__.py
10
__init__.py
@ -22,11 +22,11 @@ def mycreole_help_pagecontent():
|
||||
return creole.creole2html(MYCREOLE_HELP)
|
||||
|
||||
|
||||
def render_simple(text):
|
||||
return creole.creole2html(text)
|
||||
def render_simple(text, macros=None):
|
||||
return creole.creole2html(text, macros=macros)
|
||||
|
||||
|
||||
def render(request, text, attachment_target_path, next_anchor=''):
|
||||
def render(request, text, attachment_target_path, next_anchor='', macros=None):
|
||||
def get_attachment_name(text, state):
|
||||
end_idx = text.index(']]' if state == '[' else '}}')
|
||||
try:
|
||||
@ -84,9 +84,9 @@ def render(request, text, attachment_target_path, next_anchor=''):
|
||||
else:
|
||||
render_txt += '[[%s|Upload]]' % url_upload(request, rel_path, next_anchor)
|
||||
text = text[text.index(']]' if state == '[' else '}}') + 2:]
|
||||
return creole.creole2html(render_txt)
|
||||
return creole.creole2html(render_txt, macros=macros)
|
||||
except:
|
||||
return creole.creole2html(text)
|
||||
return creole.creole2html(text, macros=macros)
|
||||
|
||||
|
||||
def url_delete(request, rel_path, next_anchor=''):
|
||||
|
Loading…
x
Reference in New Issue
Block a user