Fix Interchange when used on images path containing parenthesis #10264
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
we faced an issue with Interchange plugin when the Interchange data contain some images with parenthesis in their URL.
The issue happens only for background style replacement.
It comes from the fact that Interchange concatenates the image path with 'url( )' which does already contain some parenthesis:
https://github.com/zurb/foundation-sites/blob/develop/js/foundation.interchange.js#L160
To fix that, i suggest escaping the parenthesis in the image path.
Example of use case
We do use Thumbor to manipulate our images.
As shown below, Thumbor's way of applying on-the-fly filter to images is by adding some keywords containing parenthesis on the picture url called:
http://thumbor.readthedocs.io/en/latest/strip_icc.html
Note for the reviewers
I've updated the test case to reflect this fix biut i'm not sure whether you prefer having a dedicated test for this case or simply, as I did, having the data used in all Interchange tests using URL containing parenthesis (this ensures that all scenarii work fine with parenthesis). Please let me know if you do prefer a dedicated test.
Cheers