Skip to content

Commit 3cd93d0

Browse files
author
jghauser
committed
fix(papis-storage): remove all control chars from strings
1 parent 9ceaed7 commit 3cd93d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/papis/papis-storage.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ function M.get_data_full(metadata)
193193

194194
-- ensure that everything is of the correct type
195195
if type_of_val == "text" then
196-
-- convert value to string and remove newline characters
197-
data[key] = string.gsub(tostring(entry[key]), "[\n\r]", "")
196+
-- convert value to string and remove stray control characters
197+
data[key] = string.gsub(tostring(entry[key]), "[%c]", "")
198198
elseif type_of_val == "luatable" then
199199
if type(entry[key]) == "table" then
200200
data[key] = entry[key]

0 commit comments

Comments
 (0)