Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse change in #415; Image paths encoded before displaying instead #474

Merged
merged 1 commit into from
Jul 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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