WIP: Add support for multiline list items.

Right now this messes with line numbers.
This commit is contained in:
Sergio Martínez Portela 2022-11-12 12:37:50 +01:00
parent ccebe90ea8
commit 6c6c375572
3 changed files with 114 additions and 40 deletions

View file

@ -51,3 +51,15 @@ Also with markup
- _Key_ :: _Value_
- /Key/ 2 :: /Value/ 2
* List with multiline elements
:PROPERTIES:
:ID: 07-list-with-multiline-elements
:CREATED: [2020-01-01 Wed 01:01]
:END:
- This is a list item...
that spans multiple lines
- This is another list item...
that has content on multiple lines

View file

@ -579,6 +579,17 @@ class TestSerde(unittest.TestCase):
self.assertEqual(lists2[1][1].counter, "2")
self.assertEqual(lists2[1][1].counter_sep, ")")
hl4 = doc.getTopHeadlines()[3]
# ...
lists4 = hl4.getLists()
print(lists4)
self.assertEqual(len(lists4), 1)
self.assertEqual(lists4[0][0].content, ["This is a list item...", "\n that spans multiple lines"])
self.assertEqual(lists4[0][0].bullet, "-")
self.assertEqual(lists4[0][1].content, ["This is another list item...", "\n that has content on multiple lines"])
self.assertEqual(lists4[0][1].bullet, "-")
def test_org_roam_07(self):
with open(os.path.join(DIR, "07-org-roam-v2.org")) as f:
orig = f.read()