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