python-docx-template
python-docx-template copied to clipboard
htmltodocx
i want add html code to word,or copy a.docx to demo.docx
test1
test2
应该实现不了,我遇到过如果带有注释符的代码(例如: <!-- ) 会导致 生成word时候 后面的内容都被注释掉,怀疑是jinja2的问题。
应该实现不了,我遇到过如果带有注释符的代码(例如: <!-- ) 会导致 生成word时候 后面的内容都被注释掉,怀疑是jinja2的问题。
我项目中应该没有这种情况,目前考虑两种方案,但是都有问题。 1.将html通过docx转成word文档,但是不知道怎么把html转的文档复制到现有文档中。 2.就是写过滤器,把html代码直接解析成正常文档,不知道这么过滤器怎么写。
If you want to add html code as a listing of code : juste use escaping (see doc) If you want to add a rendered html code, it is not possible