odf2legi: basic handling of hypertext links (#4798)

This commit is contained in:
Frédéric Péters 2014-05-07 15:13:29 +02:00
parent f664410638
commit 376df1781c
2 changed files with 11 additions and 1 deletions

View File

@ -289,7 +289,7 @@ def fill_inline(para, elem, invert_bg=False):
# Microsoft Word
fill_inline(para, child)
else:
print >> sys.stderr, 'W: got text:a, with an external reference'
handle_little_span(para, child, False)
elif child.tag == '{%s}note' % TEXT_NS:
footnote = ET.Element('footnote')

View File

@ -154,6 +154,16 @@ Plop
self.assertEqual(self.convert_to_legi(doc),
'''<para>Foo<footnote><para>Bar</para></footnote>. Baz</para>''')
def test_inline_with_link(self):
odf2legi.STYLES = {}
doc = '''\
<text:p xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0">
Plop <text:a>foobar@example.net</text:a> plop
</text:p>'''
self.assertEqual(self.convert_to_legi(doc), '''<para>Plop foobar@example.net plop\n</para>''')
class TableTestCase(unittest.TestCase):