Skip to content

Commit

Permalink
Fix #538: check for no auto-generated tag
Browse files Browse the repository at this point in the history
  • Loading branch information
jarun committed Dec 26, 2021
1 parent 4da6dae commit 0ad1a48
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion buku
Original file line number Diff line number Diff line change
Expand Up @@ -3096,7 +3096,10 @@ def import_md(filepath: str, newtag: Optional[str]):
tag_end_delim = line.rfind(' -->')

if tag_start_delim != -1 and tag_end_delim > 0:
tags = newtag + ',' + line[tag_start_delim + 11:tag_end_delim]
if newtag is not None:
tags = newtag + ',' + line[tag_start_delim + 11:tag_end_delim]
else:
tags = line[tag_start_delim + 11:tag_end_delim]
else:
tags = newtag

Expand Down

0 comments on commit 0ad1a48

Please sign in to comment.