Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Added support for multiple background images and CDN #80
Related to this post:
Example of this fix is here: https://verge-blog-demo.themes.dtbaker.net/
Before this fix the
After this fix it correctly replaces all images with the CDN url, like this:
@futtta because it's 1am here and my brain wasn't ready to jump into that beefy looking regex :) But feel free to do so!
That regex also needs to return one match for each
The other option I started to play with first was a brand new single regex that just searched for
This different approach would basically find/replace all
Do you think something like that would work better? The single regex would certainly be slightly faster.
referenced this pull request
Feb 4, 2017
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
@futtta yeah, #81 looks way better... tho the regex used might not cover all the edge cases (for example, the spec allows for any number of spaces between
I'm using a similar (but maybe more "complete") regex in my branch here: https://github.com/zytzagoo/autoptimize/blob/tests/classes/autoptimizeStyles.php#L9