diff options
| author | Michael Williamson <mike@zwobble.org> | 2013-12-14 15:15:05 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2013-12-14 15:15:05 +0000 |
| commit | 841de73928538038496f15467aba9001b47a2d9c (patch) | |
| tree | e49be2abcffebe693e74ab3f8157414b978a8ea8 /mammoth/html_generation.py | |
| parent | 14ca5c4d6993806b568ba5a9befb81326d9ed806 (diff) | |
Add appending of other HTML generators
Diffstat (limited to 'mammoth/html_generation.py')
| -rw-r--r-- | mammoth/html_generation.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mammoth/html_generation.py b/mammoth/html_generation.py index c2d0240..e276bdc 100644 --- a/mammoth/html_generation.py +++ b/mammoth/html_generation.py @@ -37,6 +37,12 @@ class HtmlGenerator(object): attribute_string = _generate_attribute_string(element.attributes) self._fragments.append("<{0}{1}>".format(element.name, attribute_string)) + def append(self, other): + if other._fragments: + self._write_all() + for fragment in other._fragments: + self._fragments.append(fragment) + def html_string(self): return "".join(self._fragments) |
