Skip to content

Commit ebeb24b

Browse files
authored
Fix support for rgba() and rgb() in tts:textShadow (#221)
1 parent 977366c commit ebeb24b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/js/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@
135135

136136
imscUtils.parseTextShadow = function (str) {
137137

138-
var shadows = str.split(",");
139-
138+
var shadows = str.match(/([^\(,\)]|\([^\)]+\))+/g);
139+
140140
var r = [];
141141

142142
for (var i in shadows) {

src/test/js/ParseTextShadowTest.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ QUnit.test("ParseTextShadow",
1818

1919
/* four components */
2020

21-
["10% -20% 5% lime", [shadow(10, "%", -20, "%", 5, "%", [0, 255, 0, 255])]]
22-
21+
["10% -20% 5% lime", [shadow(10, "%", -20, "%", 5, "%", [0, 255, 0, 255])]],
22+
["+10% 0% -1% rgba(233,30,99,255)", [shadow(10, "%", 0, "%", -1, "%", [233, 30, 99, 255])]]
2323

2424

2525
];

0 commit comments

Comments
 (0)