Encode URI of image path for card view vs. normalizePath replace (#474)
This commit is contained in:
parent
e7c859eb12
commit
cc93ad87dc
@ -41,6 +41,9 @@ export default class EntryListing extends React.Component {
|
|||||||
const title = label || entry.getIn(['data', inferedFields.titleField]);
|
const title = label || entry.getIn(['data', inferedFields.titleField]);
|
||||||
let image = entry.getIn(['data', inferedFields.imageField]);
|
let image = entry.getIn(['data', inferedFields.imageField]);
|
||||||
image = resolvePath(image, publicFolder);
|
image = resolvePath(image, publicFolder);
|
||||||
|
if(image) {
|
||||||
|
image = encodeURI(image);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
const absolutePath = new RegExp('^(?:[a-z]+:)?//', 'i');
|
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
|
export function resolvePath(path, basePath) { // eslint-disable-line
|
||||||
// No path provided, skip
|
// No path provided, skip
|
||||||
|
Loading…
x
Reference in New Issue
Block a user