Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions webodt/preprocessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ def unescape_templatetags_preprocessor(template_content):
return template_content

def xmlfor_preprocessor(template_content):
for include_text in re.findall(r'{%(.+?)%}', template_content):
new_include_text = re.sub(r'<.*?>', '', include_text)
template_content = template_content.replace(
'{%%%s%%}' % include_text, '{%%%s%%}' % new_include_text
)
tree = etree.parse(StringIO(template_content))

# 1. search for xmlfor pairs
Expand Down