Skip to content

Commit

Permalink
Parse double quotes in urls in css as well
Browse files Browse the repository at this point in the history
Fixes #13
Note that the regex was also updated to only have single quotes once between the '[]'.
  • Loading branch information
0xR authored Mar 10, 2017
1 parent 2f8e3bf commit 2f4e579
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class DissectHtml {
const self = this
// to get -> property: url(filepath)

const processed = text.replace(/url\(['|']?([^)]+?)['|']?\)/ig, function (_u, url) {
const processed = text.replace(/url\(["'|]?([^"'|)]+?)["'|]?\)/ig, function (_u, url) {
// to get -> filepath from url(filepath), url('filepath') and url('filepath')
return `url(${self._changeRelUrl(url, path.dirname(cssBasePath))})`
})
Expand Down

0 comments on commit 2f4e579

Please sign in to comment.