diff --git a/README.md b/README.md index f030443..a36ca52 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,7 @@ Pad zeroes to `value` to the left until output value's length be equal to `lengt Secretary supports most of the jinja2 control structure/flow tags. But please avoid using the following tags since they are not supported: `block`, `extends`, `macro`, `call`, `include` and `import`. ### Version History +* **0.2.3**: Fix issue [#13](https://github.com/christopher-ramirez/secretary/issues/12). * **0.2.2**: Introduce image support. * **0.2.1**: Fix issue [#8](https://github.com/christopher-ramirez/secretary/issues/8) * **0.2.0**: **Backward incompatible release**. Still compatible with existing templates. Introduce auto flow handling, better logging and minor bug fixes. diff --git a/secretary.py b/secretary.py index b32bede..d0cd2e3 100644 --- a/secretary.py +++ b/secretary.py @@ -452,7 +452,6 @@ class Renderer(object): self.replace_images(final_xml) return final_xml - except: self.log.error('Error rendering template:\n%s', xml_document.toprettyxml(), exc_info=True) @@ -483,8 +482,12 @@ class Renderer(object): self.styles = parseString(self.files['styles.xml']) self.manifest = parseString(self.files['META-INF/manifest.xml']) - # Render content.xml - self.content = self._render_xml(self.content, **kwargs) + # Render content.xml keeping just 'office:body' node. + rendered_content = self._render_xml(self.content, **kwargs) + self.content.getElementsByTagName('office:document-content')[0].replaceChild( + rendered_content.getElementsByTagName('office:body')[0], + self.content.getElementsByTagName('office:body')[0] + ) # Render styles.xml self.styles = self._render_xml(self.styles, **kwargs) diff --git a/setup.py b/setup.py index 062e826..9d9ab48 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ class PyTest(TestCommand): setup( name='secretary', - version='0.2.2', + version='0.2.3', url='https://github.com/christopher-ramirez/secretary', license='MIT', author='Christopher Ramírez',