2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-05-15 11:59:37 +03:00

feat(201): add file:// replacement (#280)

* feat: add file://

* feat: add changeset
This commit is contained in:
Nikolay Kost
2025-03-09 20:37:21 +02:00
committed by GitHub
parent 66c0931f5c
commit 9a6986965e
3 changed files with 23 additions and 1 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ function escapeAttrValue(value: string) {
.replace(/"/g, '"')
.replace(/'/g, ''')
// eslint-disable-next-line no-script-url
.replace(/(javascript|data|vbscript):/gi, '$1%3A');
.replace(/(javascript|data|vbscript|file):/gi, '$1%3A');
}
/**
@@ -99,6 +99,11 @@ describe('@bbob/plugin-helper/helpers', () => {
href: `JAVASCRIPT:alert('hello')`,
})).toBe(` onclick="JAVASCRIPT%3Aalert('hello')" href="JAVASCRIPT%3Aalert('hello')"`)
});
test(`file:alert("hello")`, () => {
expect(attrsToString({
href: `file:///shared/customer_info/customer-name`,
})).toBe(` href="file%3A///shared/customer_info/customer-name"`)
});
test(`<tag>`, () => {
expect(attrsToString({
onclick: `<tag>`,