diff --git a/odf2legi/odf2legi.py b/odf2legi/odf2legi.py
index 28ce406..12b307a 100644
--- a/odf2legi/odf2legi.py
+++ b/odf2legi/odf2legi.py
@@ -257,7 +257,12 @@ def fill_inline(para, elem, invert_bg=False):
'''
if elem.text:
- para.text = elem.text.strip('\n')
+ if para.getchildren():
+ if para.getchildren()[-1].tail is None:
+ para.getchildren()[-1].tail = ''
+ para.getchildren()[-1].tail += elem.text.strip('\n')
+ else:
+ para.text = elem.text.strip('\n')
for child in elem.getchildren():
if child.tag == '{%s}span' % TEXT_NS and child.getchildren():
diff --git a/odf2legi/tests.py b/odf2legi/tests.py
index 4288779..337d1e1 100644
--- a/odf2legi/tests.py
+++ b/odf2legi/tests.py
@@ -142,6 +142,18 @@ Plop
self.assertEqual(self.convert_to_legi(doc),
'''FooBar. Baz''')
+ def test_footnotes_bug4254bis(self):
+ doc = '''\
+Foo
+2Bar. Baz
+'''
+
+ self.assertEqual(self.convert_to_legi(doc),
+ '''FooBar. Baz''')
+
class TableTestCase(unittest.TestCase):
@@ -458,6 +470,41 @@ class ListTestCase(unittest.TestCase):
odf2legi.convert_to_legi_xml(doc),
'''ChapterPremiere listeSecond niveauTres simple''')
+ def test_list_with_footnote(self):
+ doc = '''\
+
+
+
+
+
+
+
+
+
+
+
+
+Chapter
+
+
+ Premiere2Bar. liste
+
+
+
+
+
+'''
+ self.assertEqual(
+ odf2legi.convert_to_legi_xml(doc),
+ '''ChapterPremiereBar. liste''')
+
class FigureTestCase(unittest.TestCase):
def test_figure(self):