Add support for markdown and link parsing on lists.

This commit is contained in:
Sergio Martínez Portela 2021-08-03 23:05:15 +02:00
parent 7cf643200e
commit 7e944bcb3d
2 changed files with 24 additions and 9 deletions

View file

@ -99,6 +99,8 @@ def get_tokens(value):
return value.contents
if isinstance(value, RawLine):
return [value.line]
if isinstance(value, list):
return value
raise Exception("Unknown how to get tokens from: {}".format(value))
@ -361,6 +363,10 @@ class Headline:
for content in self.contents:
yield from get_links_from_content(content)
for lst in self.getLists():
for item in lst:
yield from get_links_from_content(item.content)
def get_lines_between(self, start, end):
for line in self.contents:
if start <= line.linenum < end:
@ -1551,7 +1557,9 @@ class OrgDocReader:
match.group("checkbox_value"),
match.group("tag_indentation"),
match.group("tag"),
match.group("content"),
parse_content_block(
[RawLine(linenum=linenum, line=match.group("content"))]
).contents,
)
if len(self.headline_hierarchy) == 0: