Skip to content

Commit 99c2907

Browse files
authored
test(svg): escapes script injection characters in escapeXML (JhaSourav07#1593)
## Description Fixes JhaSourav07#1578 ## Pillar - [x] 🛠️ Other (Bug fix, refactoring, docs) ## Visual Preview No visual changes — this is a test-only PR. ## Checklist before requesting a review: - [x] I have read the `CONTRIBUTING.md` file. - [x] I have tested these changes locally. - [x] I have run `npm run format` and `npm run lint` locally and resolved all errors. - [x] My commits follow the Conventional Commits format. - [x] I have made sure that i have only one commit to merge in this PR. - [x] I have starred the repo.
2 parents 7dd8c04 + 45f7d86 commit 99c2907

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/svg/generator.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,9 @@ describe('escapeXML', () => {
11091109
const safe = 'Hello World 123!@#%^*()_+-=[]{}|;:,./?`~';
11101110
expect(escapeXML(safe)).toBe(safe);
11111111
});
1112+
it('escapes script injection characters <script>&" together', () => {
1113+
expect(escapeXML('<script>&"')).toBe('&lt;script&gt;&amp;&quot;');
1114+
});
11121115
});
11131116

11141117
describe('particleCount', () => {

0 commit comments

Comments
 (0)