forked from kenkeiras/org-rw
Compare commits
No commits in common. "fix/strip-title" and "develop" have entirely different histories.
fix/strip-
...
develop
@ -415,6 +415,7 @@ class Headline:
|
|||||||
isinstance(line, DelimiterLine)
|
isinstance(line, DelimiterLine)
|
||||||
and line.delimiter_type == DelimiterLineType.END_BLOCK
|
and line.delimiter_type == DelimiterLineType.END_BLOCK
|
||||||
):
|
):
|
||||||
|
|
||||||
start = current_node.header.linenum
|
start = current_node.header.linenum
|
||||||
end = line.linenum
|
end = line.linenum
|
||||||
|
|
||||||
@ -814,6 +815,7 @@ class Headline:
|
|||||||
|
|
||||||
def set_property(self, name: str, value: str):
|
def set_property(self, name: str, value: str):
|
||||||
for prop in self.properties:
|
for prop in self.properties:
|
||||||
|
|
||||||
# A matching property is found, update it
|
# A matching property is found, update it
|
||||||
if prop.key == name:
|
if prop.key == name:
|
||||||
prop.value = value
|
prop.value = value
|
||||||
@ -998,6 +1000,7 @@ class Headline:
|
|||||||
and result_first[0] == "structural"
|
and result_first[0] == "structural"
|
||||||
and result_first[1].strip().upper() == ":RESULTS:"
|
and result_first[1].strip().upper() == ":RESULTS:"
|
||||||
):
|
):
|
||||||
|
|
||||||
(end_line, _) = self.get_structural_end_after(
|
(end_line, _) = self.get_structural_end_after(
|
||||||
kword.linenum + 1
|
kword.linenum + 1
|
||||||
)
|
)
|
||||||
@ -1792,7 +1795,7 @@ def token_list_to_plaintext(tok_list) -> str:
|
|||||||
else:
|
else:
|
||||||
assert isinstance(chunk, MarkerToken)
|
assert isinstance(chunk, MarkerToken)
|
||||||
|
|
||||||
return "".join(contents).strip()
|
return "".join(contents)
|
||||||
|
|
||||||
|
|
||||||
def token_list_to_raw(tok_list):
|
def token_list_to_raw(tok_list):
|
||||||
@ -2014,6 +2017,7 @@ def tokenize_contents(contents: str) -> List[TokenItems]:
|
|||||||
and is_pre(last_char)
|
and is_pre(last_char)
|
||||||
and ((i + 1 < len(contents)) and is_border(contents[i + 1]))
|
and ((i + 1 < len(contents)) and is_border(contents[i + 1]))
|
||||||
):
|
):
|
||||||
|
|
||||||
is_valid_mark = False
|
is_valid_mark = False
|
||||||
# Check that is closed later
|
# Check that is closed later
|
||||||
text_in_line = True
|
text_in_line = True
|
||||||
@ -2404,6 +2408,7 @@ class OrgDoc:
|
|||||||
|
|
||||||
# Writing
|
# Writing
|
||||||
def dump_headline(self, headline, recursive=True):
|
def dump_headline(self, headline, recursive=True):
|
||||||
|
|
||||||
tags = ""
|
tags = ""
|
||||||
if len(headline.shallow_tags) > 0:
|
if len(headline.shallow_tags) > 0:
|
||||||
tags = ":" + ":".join(headline.shallow_tags) + ":"
|
tags = ":" + ":".join(headline.shallow_tags) + ":"
|
||||||
@ -2417,14 +2422,7 @@ class OrgDoc:
|
|||||||
if not (raw_title.endswith(" ") or raw_title.endswith("\t")) and tags:
|
if not (raw_title.endswith(" ") or raw_title.endswith("\t")) and tags:
|
||||||
tags_padding = " "
|
tags_padding = " "
|
||||||
|
|
||||||
yield (
|
yield "*" * headline.depth + headline.spacing + state + raw_title + tags_padding + tags
|
||||||
"*" * headline.depth
|
|
||||||
+ headline.spacing
|
|
||||||
+ state
|
|
||||||
+ raw_title
|
|
||||||
+ tags_padding
|
|
||||||
+ tags
|
|
||||||
)
|
|
||||||
|
|
||||||
planning = headline.get_planning_line()
|
planning = headline.get_planning_line()
|
||||||
if planning is not None:
|
if planning is not None:
|
||||||
|
Loading…
Reference in New Issue
Block a user