Ticket #3: macro.patch
| File macro.patch, 1.4 kB (added by fimion, 4 years ago) |
|---|
-
old/macro.py
old new 105 105 wiki_page = WikiPage(self.env, 'templates/' + name) 106 106 html = wiki_page.text 107 107 # args = util.escape(args) 108 108 109 #################### 110 # BEGIN FIMII EDIT # 111 #################### 112 strip_p = False 113 strip_n = False 114 # Check for {{!p}} and {{!n}} 115 while (html.find('{{!p}}',0,6) != -1 or html.find('{{!n}}',0,6) != -1): 116 if (html.find('{{!p}}',0,6) != -1): 117 html = html.replace('{{!p}}','') 118 strip_p = True 119 if (html.find('{{!n}}',0,6) != -1): 120 html = html.replace('{{!n}}','') 121 strip_n = True 122 ################## 123 # END FIMII EDIT # 124 ################## 125 109 126 110 127 # Now let's replace the holders with the passed arguments 111 128 i = 0 … … 116 133 html = html.replace('{{%d}}' % (i+1), args[i]) 117 134 i += 1 118 135 119 # Finaly return the HTML to include 120 return wiki_to_html(html, self.env, req) 136 #################### 137 # BEGIN FIMII EDIT # 138 #################### 139 html = wiki_to_html(html, self.env, req) 140 if(strip_p): 141 html = html.replace('<p>','') 142 html = html.replace('</p>','') 143 if(strip_n): 144 html = html.strip() 145 return html 146 ################## 147 # END FIMII EDIT # 148 ################## 149 150 151 152
