2
0
mirror of https://github.com/thumbsup/thumbsup synced 2024-11-11 07:10:26 +00:00

Add in escaping of quotes for relative paths (#145)

* Add in escaping of quotes for relative paths

* Add double quote escaping

* Fix lint errors

* Always escape relative paths
This commit is contained in:
Andrew McOlash 2019-02-14 22:07:19 -08:00 committed by Romain
parent 63990904d0
commit 11da4850c8

View File

@ -2,5 +2,10 @@ const path = require('path')
module.exports = (target, options) => {
const albumPath = options.data.root.album.path
return path.relative(path.dirname(albumPath), target)
var relative = path.relative(path.dirname(albumPath), target)
// Escape single/double quotes
var escaped = relative.replace(/'/g, '%27')
escaped = escaped.replace(/"/g, '%22')
return escaped
}