Skip to content

Commit d682ce2

Browse files
fix: Merge pull request #240 from dharamghevariya/overlays-special-characters-encoding
fix: encode multiple occurrences of special characters properly
2 parents 363176b + 4018058 commit d682ce2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/url-loader/src/plugins/overlays.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ export const OverlaysPlugin = /* #__PURE__ */ plugin({
312312
keyof typeof specialCharacters
313313
>
314314
)?.forEach((character: string) => {
315-
layerText = layerText?.replace(
315+
layerText = layerText?.replaceAll(
316316
character,
317317
specialCharacters[character],
318318
);

packages/url-loader/tests/plugins/overlays.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,8 @@ describe("Plugins", () => {
418418

419419
const color = "white";
420420
const fontFamily = "Source Sans Pro";
421-
const text = "Ne xt/Cloud.in,ary";
422-
const expectedText = "Ne%20xt%252FCloud%252Ein%252Cary";
421+
const text = "Ne xt/Cloud.in,,ary";
422+
const expectedText = "Ne%20xt%252FCloud%252Ein%252C%252Cary";
423423

424424
const options = {
425425
src: TEST_PUBLIC_ID,

0 commit comments

Comments
 (0)