NetAngels / django-webodt

django module to create MS Word, PDF and other types of documents from ODF and HTML templates
http://packages.python.org/django-webodt/
93 stars 52 forks source link

styles in {{}} #15

Open luk156 opened 11 years ago

luk156 commented 11 years ago

If in a variable declaration if there is different style give me an error:

Could not parse the remainder: '/text:spancale/text:span' from 'fattura.cliente.cod_fis/text:spancale/text:span'

also if i modify an existing .odt replacing only few character i've the same problem becouse libreoffice insert new span (sorry for my english)

luk156 commented 11 years ago

i resolve add thi line to

def unescape_templatetags_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
        )