Skip to content

Commit

Permalink
Encode URI of image path for card view vs. normalizePath replace (#474)
Browse files Browse the repository at this point in the history
  • Loading branch information
jholmes033169 authored and Benaiah committed Jul 10, 2017
1 parent e7c859e commit cc93ad8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/components/EntryListing/EntryListing.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/lib/pathHelper.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit cc93ad8

Please sign in to comment.