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:
@@ -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>`,
|
||||
|
||||
Reference in New Issue
Block a user