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:
parent
63990904d0
commit
11da4850c8
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user