@capillarytech/cap-ui-utils 1.4.32-alpha.1 → 1.4.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
TMPL_SANITIZE_FORBIDDEN_TAGS,
|
|
3
|
+
TMPL_SANITIZE_FORBIDDEN_ATTRS,
|
|
4
|
+
TMPL_SANITIZE_FORBIDDEN_JS_TAGS,
|
|
5
|
+
} from "./constants";
|
|
2
6
|
|
|
3
7
|
/**
|
|
4
8
|
* Sanitizes the given content by removing forbidden HTML tags, attributes, and JavaScript code.
|
|
@@ -8,12 +12,9 @@ import { TMPL_SANITIZE_FORBIDDEN_TAGS, TMPL_SANITIZE_FORBIDDEN_ATTRS, TMPL_SANIT
|
|
|
8
12
|
*/
|
|
9
13
|
const sanitizeTemplateWithRegexp = (content) => {
|
|
10
14
|
try {
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const tagsJoined = forbiddenTags.join("|");
|
|
15
|
-
const attrsJoined = forbiddenAttrs.join("|");
|
|
16
|
-
const jsKeywordsJoined = forbiddenHrefJavaScript.join("|");
|
|
15
|
+
const tagsJoined = TMPL_SANITIZE_FORBIDDEN_TAGS.join("|");
|
|
16
|
+
const attrsJoined = TMPL_SANITIZE_FORBIDDEN_ATTRS.join("|");
|
|
17
|
+
const jsKeywordsJoined = TMPL_SANITIZE_FORBIDDEN_JS_TAGS.join("|");
|
|
17
18
|
|
|
18
19
|
// Full tag regex: Matches complete HTML tags including their content for specified forbidden tags.
|
|
19
20
|
const fullTagRegex = new RegExp(
|