summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordkuhlman <dkuhlman@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2013-04-08 17:35:15 +0000
committerdkuhlman <dkuhlman@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2013-04-08 17:35:15 +0000
commit886107c3e54ea52e5b8c7b117427010c78ce602d (patch)
tree927f68e9c7dee7cf8b1af4d3381d5bf881d5cead
parent1736a3372d7312f1ad794bb8ddd90f22305bf67a (diff)
downloaddocutils-886107c3e54ea52e5b8c7b117427010c78ce602d.tar.gz
Ticket #102: Fix citation rendering in rst2odt with --create-links option
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@7645 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
-rw-r--r--docutils/writers/odf_odt/__init__.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/docutils/writers/odf_odt/__init__.py b/docutils/writers/odf_odt/__init__.py
index e836dfac3..f02500513 100644
--- a/docutils/writers/odf_odt/__init__.py
+++ b/docutils/writers/odf_odt/__init__.py
@@ -2015,21 +2015,27 @@ class ODFTranslator(nodes.GenericNodeVisitor):
elif self.citation_id is not None:
el = self.append_p('textbody')
self.set_current_element(el)
- el.text = '['
if self.settings.create_links:
+ el0 = SubElement(el, 'text:span')
+ el0.text = '['
el1 = self.append_child('text:reference-mark-start', attrib={
'text:name': '%s' % (self.citation_id, ),
})
+ else:
+ el.text = '['
def depart_label(self, node):
if isinstance(node.parent, docutils.nodes.footnote):
pass
elif self.citation_id is not None:
- self.current_element.text += ']'
if self.settings.create_links:
el = self.append_child('text:reference-mark-end', attrib={
'text:name': '%s' % (self.citation_id, ),
})
+ el0 = SubElement(self.current_element, 'text:span')
+ el0.text = ']'
+ else:
+ self.current_element.text += ']'
self.set_to_parent()
def visit_generated(self, node):