Skip to content

Commit

Permalink
(fix carnager#27) Show Bookmark tag correctly
Browse files Browse the repository at this point in the history
* tag parsing changed to search for tag in last line. This fixes buku
showing a url summary in the 3rd line.
  • Loading branch information
isaaclo123 committed Apr 23, 2019
1 parent 54fcdd7 commit 27be75a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions buku_run
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,12 @@ BEGIN {
FS="\n"
}
{
if ($3 == "")
$3 = " # NOTAG"
tag = $NF
if (substr(tag, 0, 4) != " #")
tag = " # NOTAG"
id = gensub(/([0-9]+)\.(.*)/, "\\1", "g", $1)
url = substr(gensub(/\s+> (.*)/, "\\1", "g", $2),0,max)
tags = gensub(/\s+# (.*)/, "\\1", "g", $3)
tags = gensub(/\s+# (.*)/, "\\1", "g", tag)
title = substr(gensub(/[0-9]+\.\s*(.*)/, "\\1", "g", $1),0,max)
if (type == 1)
Expand Down Expand Up @@ -324,7 +325,10 @@ getTagsFromId () {
FS="\n"
}
{
print gensub(/\s+# (.*)/, "\\1", "g", $3)
tag = $NF
if (substr(tag, 0, 4) != " #")
tag = "# "
print gensub(/\s+# (.*)/, "\\1", "g", tag)
}
')"
}
Expand Down

0 comments on commit 27be75a

Please sign in to comment.