Encode URI of image path for card view vs. normalizePath replace (#474)

This commit is contained in:
Jerry Holmes 2017-07-10 13:36:07 -04:00 committed by Benaiah Mischenko
parent e7c859eb12
commit cc93ad87dc
2 changed files with 4 additions and 1 deletions

View File

@ -41,6 +41,9 @@ export default class EntryListing extends React.Component {
const title = label || entry.getIn(['data', inferedFields.titleField]);
let image = entry.getIn(['data', inferedFields.imageField]);
image = resolvePath(image, publicFolder);
if(image) {
image = encodeURI(image);
}
return (
<Card

View File

@ -1,5 +1,5 @@
const absolutePath = new RegExp('^(?:[a-z]+:)?//', 'i');
const normalizePath = path => path.replace(/[\\\/]+/g, '/').replace(/[\s]+/g, '%20');
const normalizePath = path => path.replace(/[\\\/]+/g, '/');
export function resolvePath(path, basePath) { // eslint-disable-line
// No path provided, skip