mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-06-05 09:43:58 -04:00
parent
cc1e58e243
commit
8967193bb9
1 changed files with 3 additions and 2 deletions
|
@ -532,8 +532,9 @@ new function() {
|
||||||
var definitions = {};
|
var definitions = {};
|
||||||
function getDefinition(value) {
|
function getDefinition(value) {
|
||||||
// When url() comes from a style property, '#'' seems to be missing on
|
// When url() comes from a style property, '#'' seems to be missing on
|
||||||
// WebKit, so let's make it optional here:
|
// WebKit. We also get variations of quotes or no quotes, single or
|
||||||
var match = value && value.match(/\((?:#|)([^)']+)/);
|
// double, so handle it all with one regular expression:
|
||||||
|
var match = value && value.match(/\((?:["'#]*)([^"')]+)/);
|
||||||
return match && definitions[match[1]];
|
return match && definitions[match[1]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue