[plugin] Exporter: use util.getSafeFilename() to remove illegal characters from output filename (#10282)

Fixes #10281.
reviewable/pr10287/r1
Mochitto 1 year ago committed by GitHub
parent 2e630286df
commit d39cc78f9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -93,7 +93,7 @@ function BaseExporter:getFilePath(t)
if not self.is_remote then
local filename = string.format("%s-%s.%s",
self:getTimeStamp(),
#t == 1 and t[1].exportable_title or "all-books",
#t == 1 and t[1].output_filename or "all-books",
self.extension)
return self.clipping_dir .. "/" .. getSafeFilename(filename)
end

@ -394,8 +394,8 @@ function MyClipping:getDocMeta(view)
end
return {
title = title,
-- To make sure that export doesn't fail due to unsupported charchters.
exportable_title = parsed_title,
-- Replaces characters that are invalid in filenames.
output_filename = util.getSafeFilename(title),
author = author,
number_of_pages = number_of_pages,
file = view.document.file,

Loading…
Cancel
Save