Skip to content

Commit

Permalink
support tags surrounded by quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rene Schallner committed Dec 11, 2021
1 parent 9e97e8a commit 6429239
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/taglinks/tagutils.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local Job = require("plenary.job")

local M = {}
local hashtag_re = "(^|\\s)#[a-zA-Z]+[a-zA-Z0-9/\\-_]*"
local hashtag_re = "(^|\\s|'|\")#[a-zA-Z]+[a-zA-Z0-9/\\-_]*"
local colon_re = "(^|\\s):[a-zA-Z]+[a-zA-Z0-9/\\-_]*:"
local yaml_re = "(^|\\s)tags:\\s*\\[([a-zA-Z]+[a-zA-Z0-9/\\-_]*(,\\s)*)*]"

Expand All @@ -22,6 +22,9 @@ local function command_find_all_tags(opts)
end

local function trim(s)
if s:sub(1, 1) == '"' or s:sub(1, 1) == "'" then
s = s:sub(2)
end
return (string.gsub(s, "^%s*(.-)%s*$", "%1"))
end

Expand Down

0 comments on commit 6429239

Please sign in to comment.