Compare commits
2 commits
e07964af55
...
24dc516d64
Author | SHA1 | Date | |
---|---|---|---|
|
24dc516d64 | ||
|
7375a69229 |
1 changed files with 18 additions and 2 deletions
|
@ -415,6 +415,7 @@ class Headline:
|
||||||
if (
|
if (
|
||||||
isinstance(line, DelimiterLine)
|
isinstance(line, DelimiterLine)
|
||||||
and line.delimiter_type == DelimiterLineType.END_BLOCK
|
and line.delimiter_type == DelimiterLineType.END_BLOCK
|
||||||
|
and line.type_data.subtype == current_node.header.type_data.subtype
|
||||||
):
|
):
|
||||||
|
|
||||||
start = current_node.header.linenum
|
start = current_node.header.linenum
|
||||||
|
@ -872,9 +873,24 @@ class Headline:
|
||||||
yield from get_links_from_content(item.content)
|
yield from get_links_from_content(item.content)
|
||||||
|
|
||||||
def get_lines_between(self, start, end):
|
def get_lines_between(self, start, end):
|
||||||
for line in self.contents:
|
# @TODO: Generalize for other line types too.
|
||||||
|
everything = (
|
||||||
|
[]
|
||||||
|
# + self.keywords
|
||||||
|
+ self.contents
|
||||||
|
# + self.list_items
|
||||||
|
# + self.table_rows
|
||||||
|
# + self.properties
|
||||||
|
# + self.structural
|
||||||
|
+ self.delimiters
|
||||||
|
)
|
||||||
|
|
||||||
|
for line in everything:
|
||||||
if start <= line.linenum < end:
|
if start <= line.linenum < end:
|
||||||
yield "".join(line.get_raw())
|
if 'get_raw' in dir(line):
|
||||||
|
yield "".join(line.get_raw())
|
||||||
|
else:
|
||||||
|
yield line.line
|
||||||
|
|
||||||
def get_contents(self, format):
|
def get_contents(self, format):
|
||||||
if format == "raw":
|
if format == "raw":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue