fix: unescape anonymous nodes with escape sequences

This will enable the linter to recognize LaTeX commands like
`\usepackage` though it will appear as `"\\usepackage"` in the
query files.
master
Stephan Seitz 3 years ago
parent d96cef521d
commit 946ebc734a

@ -93,7 +93,7 @@ function M.lint(query_buf)
local node_type = ts_utils.get_node_text(node)[1]
if anonymous_node then
node_type = node_type:gsub('"(.*)".*$', "%1")
node_type = node_type:gsub('"(.*)".*$', "%1"):gsub('\\(.)', '%1')
end
local is_named = named_node ~= nil

Loading…
Cancel
Save