Skip to content

Commit 31304b0

Browse files
author
jghauser
committed
fix(papis-storage): remove newline/carrage return chars when importing
1 parent 0447b3b commit 31304b0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lua/papis/papis-storage.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +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-
data[key] = tostring(entry[key])
196+
-- convert value to string and remove newline characters
197+
data[key] = string.gsub(tostring(entry[key]), "[\n\r]", "")
197198
elseif type_of_val == "luatable" then
198199
if type(entry[key]) == "table" then
199200
data[key] = entry[key]

0 commit comments

Comments
 (0)