Skip to content

Commit

Permalink
fix:url not match correctly when the url includes brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
马岩 committed Jan 6, 2025
1 parent d5327ef commit e71b3e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dom-to-image-more.js
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@
}

function newInliner() {
const URL_REGEX = /url\(['"]?([^'"]+?)['"]?\)/g;
const URL_REGEX = /url\((['"]?)([^'"]+?)\1\)/g;

return {
inlineAll: inlineAll,
Expand All @@ -1051,7 +1051,7 @@
const result = [];
let match;
while ((match = URL_REGEX.exec(string)) !== null) {
result.push(match[1]);
result.push(match[2]);
}
return result.filter(function (url) {
return !util.isDataUrl(url);
Expand Down

0 comments on commit e71b3e8

Please sign in to comment.