Improve SVG definition id parsing.

Closes 
This commit is contained in:
Jürg Lehni 2015-12-27 19:56:14 +01:00
parent cc1e58e243
commit 8967193bb9

View file

@ -532,8 +532,9 @@ new function() {
var definitions = {};
function getDefinition(value) {
// When url() comes from a style property, '#'' seems to be missing on
// WebKit, so let's make it optional here:
var match = value && value.match(/\((?:#|)([^)']+)/);
// WebKit. We also get variations of quotes or no quotes, single or
// double, so handle it all with one regular expression:
var match = value && value.match(/\((?:["'#]*)([^"')]+)/);
return match && definitions[match[1]];
}