diff options
Diffstat (limited to 'docutils')
| -rw-r--r-- | docutils/docutils/writers/odf_odt/__init__.py | 5 | ||||
| -rw-r--r-- | docutils/test/functional/expected/odt_classifier.odt | bin | 0 -> 9139 bytes | |||
| -rw-r--r-- | docutils/test/functional/input/odt_classifier.txt | 13 | ||||
| -rwxr-xr-x | docutils/test/test_writers/test_odt.py | 3 |
4 files changed, 18 insertions, 3 deletions
diff --git a/docutils/docutils/writers/odf_odt/__init__.py b/docutils/docutils/writers/odf_odt/__init__.py index 0b61cec84..60077f2a8 100644 --- a/docutils/docutils/writers/odf_odt/__init__.py +++ b/docutils/docutils/writers/odf_odt/__init__.py @@ -1938,9 +1938,8 @@ class ODFTranslator(nodes.GenericNodeVisitor): self.bumped_list_level_stack.pop() def visit_classifier(self, node): - els = self.current_element.getchildren() - if len(els) > 0: - el = els[-1] + if len(self.current_element) > 0: + el = self.current_element[-1] el1 = SubElement( el, 'text:span', attrib={'text:style-name': self.rststyle('emphasis')}) diff --git a/docutils/test/functional/expected/odt_classifier.odt b/docutils/test/functional/expected/odt_classifier.odt Binary files differnew file mode 100644 index 000000000..580a9133d --- /dev/null +++ b/docutils/test/functional/expected/odt_classifier.odt diff --git a/docutils/test/functional/input/odt_classifier.txt b/docutils/test/functional/input/odt_classifier.txt new file mode 100644 index 000000000..f1aecbe12 --- /dev/null +++ b/docutils/test/functional/input/odt_classifier.txt @@ -0,0 +1,13 @@ +Definition Lists +---------------- + +Term + Definition +Term : classifier + Definition paragraph 1. + + Definition paragraph 2. +Term + Definition + + diff --git a/docutils/test/test_writers/test_odt.py b/docutils/test/test_writers/test_odt.py index 9f1fa7be3..a7a033792 100755 --- a/docutils/test/test_writers/test_odt.py +++ b/docutils/test/test_writers/test_odt.py @@ -202,6 +202,9 @@ class DocutilsOdtTestCase(DocutilsTestSupport.StandardTestCase): def test_odt_contents(self): self.process_test('odt_contents.txt', 'odt_contents.odt') + def test_odt_classifier(self): + self.process_test('odt_classifier.txt', 'odt_classifier.odt') + # # Template for new tests. # Also add functional/input/odt_xxxx.txt and |
