python docx template

linkaiyi
Follow

render docx template with special characters

special characters must be escaped before rendering


    context = { 'var':R('my text') } and {{r <var> }} in the template (note the r),
    context = { 'var':'my text'} and {{ <var>|e }} in your word template
    context = { 'var':escape('my text')} and {{ <var> }} in the template.
    doc.render(context, autoescape=True)
Object has 0 attachments

Was this article helpful?

This article is viewed 52 times!

Recent Viewed Articles

0 Comments

Leave a Comment

Support