Skip to content

Commit

Permalink
Remove state marker from logseq task description
Browse files Browse the repository at this point in the history
`logseqstate` is already a provided UDA field and thus can be inserted
into the description via templating.
  • Loading branch information
ctem committed Jan 7, 2025
1 parent ce92e3a commit e8eef3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion bugwarrior/services/logseq.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,11 @@ def _compress_tag_format(self, tag):

# get an optimized and formatted title
def get_formatted_title(self):
# use first line only and remove priority
# use first line only and remove state and priority
first_line = (
self.record["content"]
.split("\n")[0] # only use first line
.split(self.get_logseq_state() + " ")[1] # remove state marker
.replace("[#A] ", "") # remove priority markers
.replace("[#B] ", "")
.replace("[#C] ", "")
Expand Down
4 changes: 2 additions & 2 deletions tests/test_logseq.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_to_taskwarrior(self):
issue.ID: int(self.test_record["id"]),
issue.UUID: self.test_record["uuid"],
issue.STATE: self.test_record["marker"],
issue.TITLE: "DOING Do something",
issue.TITLE: "Do something",
issue.URI: "logseq://graph/Test?block-id=66699a83-3ee0-4edc-81c6-a24c9b80bec6",
}

Expand Down Expand Up @@ -95,7 +95,7 @@ def test_issues(self):
issue.ID: int(self.test_record["id"]),
issue.UUID: self.test_record["uuid"],
issue.STATE: self.test_record["marker"],
issue.TITLE: "DOING Do something",
issue.TITLE: "Do something",
issue.URI: "logseq://graph/Test?block-id=66699a83-3ee0-4edc-81c6-a24c9b80bec6",
}

Expand Down

0 comments on commit e8eef3f

Please sign in to comment.