Skip to content

Commit 90337e7

Browse files
committed
SVGData: allow single or double quotes in url()
Both quotes must match
1 parent c4172dc commit 90337e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

format/svg/SVGData.hx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class SVGData extends Group {
3434
private static var mScaleMatch = ~/scale\((.*)\)/;
3535
private static var mMatrixMatch = ~/matrix\((.*?)[, ]+(.*?)[, ]+(.*?)[, ]+(.*?)[, ]+(.*?)[, ]+(.*?)\)/;
3636
private static var mRotationMatch = ~/rotate\(([0-9\.]+)(\s+([0-9\.]+)\s*[, ]\s*([0-9\.]+))?\)/;
37-
private static var mURLMatch = ~/url\(#(.*)\)/;
37+
private static var mURLMatch = ~/url\(('|"?)#(.*)\1\)/;
3838
private static var mRGBMatch = ~/rgb\s*\(\s*(\d+)\s*(%)?\s*,\s*(\d+)\s*(%)?\s*,\s*(\d+)\s*(%)?\s*\)/;
3939
private static var defaultFill = FillSolid(0x000000);
4040

@@ -246,7 +246,7 @@ class SVGData extends Group {
246246

247247
if (mURLMatch.match (s)) {
248248

249-
var url = mURLMatch.matched (1);
249+
var url = mURLMatch.matched (2);
250250

251251
if (mGrads.exists (url)) {
252252

0 commit comments

Comments
 (0)