From 2abea3c4aec4716a2609828faddcd6b6e4c7728e Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Sat, 5 Oct 2024 20:16:30 +0200 Subject: [PATCH] Added the possibility to pass a macro filter to the render methods --- __init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/__init__.py b/__init__.py index 2098a35..df6bc51 100644 --- a/__init__.py +++ b/__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=''):