Kaynağa Gözat

Added the possibility to pass a macro filter to the render methods

make_mycreole_indenpendent_from_patt
Dirk Alders 3 hafta önce
ebeveyn
işleme
2abea3c4ae
1 değiştirilmiş dosya ile 5 ekleme ve 5 silme
  1. 5
    5
      __init__.py

+ 5
- 5
__init__.py Dosyayı Görüntüle

@@ -22,11 +22,11 @@ def mycreole_help_pagecontent():
22 22
     return creole.creole2html(MYCREOLE_HELP)
23 23
 
24 24
 
25
-def render_simple(text):
26
-    return creole.creole2html(text)
25
+def render_simple(text, macros=None):
26
+    return creole.creole2html(text, macros=macros)
27 27
 
28 28
 
29
-def render(request, text, attachment_target_path, next_anchor=''):
29
+def render(request, text, attachment_target_path, next_anchor='', macros=None):
30 30
     def get_attachment_name(text, state):
31 31
         end_idx = text.index(']]' if state == '[' else '}}')
32 32
         try:
@@ -84,9 +84,9 @@ def render(request, text, attachment_target_path, next_anchor=''):
84 84
                 else:
85 85
                     render_txt += '[[%s|Upload]]' % url_upload(request, rel_path, next_anchor)
86 86
                     text = text[text.index(']]' if state == '[' else '}}') + 2:]
87
-        return creole.creole2html(render_txt)
87
+        return creole.creole2html(render_txt, macros=macros)
88 88
     except:
89
-        return creole.creole2html(text)
89
+        return creole.creole2html(text, macros=macros)
90 90
 
91 91
 
92 92
 def url_delete(request, rel_path, next_anchor=''):

Loading…
İptal
Kaydet