From 48d94e853807a2bcebe7c6ff93e97517808aa089 Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Fri, 20 Jan 2023 00:43:27 -0500 Subject: [PATCH] chore: improve custom sanitizer regex - the previous implementation was a little too agressive on the words that had `on...`, for example this sentence `Link Text` was being replaced to `Link Text` but it shouldn't. The new PR adresses this and makes a little less agressive --- .../vanilla-force-bundle/src/salesforce-global-grid-options.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vanilla-force-bundle/src/salesforce-global-grid-options.ts b/packages/vanilla-force-bundle/src/salesforce-global-grid-options.ts index 3f23d619c..974fc05e9 100644 --- a/packages/vanilla-force-bundle/src/salesforce-global-grid-options.ts +++ b/packages/vanilla-force-bundle/src/salesforce-global-grid-options.ts @@ -61,7 +61,7 @@ export const SalesforceGlobalGridOptions = { iconSortAscCommand: 'fa fa-sort-amount-asc mdi mdi-arrow-up', iconSortDescCommand: 'fa fa-sort-amount-desc mdi mdi-arrow-down', }, - sanitizer: (dirtyHtml: string) => typeof dirtyHtml === 'string' ? dirtyHtml.replace(/(\b)(on\S+)(\s*)=|javascript:([^>]*)[^>]*|(<\s*)(\/*)script([<>]*).*(<\s*)(\/*)script(>*)|(<)(\/*)(script|script defer)(.*)(>|>">)/gi, '') : dirtyHtml, + sanitizer: (dirtyHtml: string) => typeof dirtyHtml === 'string' ? dirtyHtml.replace(/(\b)(on[a-z]+)(\s*)=|javascript:([^>]*)[^>]*|(<\s*)(\/*)script([<>]*).*(<\s*)(\/*)script(>*)|(<)(\/*)(script|script defer)(.*)(>|>">)/gi, '') : dirtyHtml, showCustomFooter: true, customFooterOptions: { hideMetrics: false,