cf-pagetree-parser 1.0.2 → 1.0.3
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/dist/cf-pagetree-parser.js +8 -8
- package/package.json +1 -1
- package/src/utils.js +2 -16
|
@@ -30,11 +30,12 @@ function sanitizeHtml(html) {
|
|
|
30
30
|
* ============================================================================
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Sanitize HTML - passthrough for trusted FunnelWind source content
|
|
35
|
+
*/
|
|
36
|
+
function sanitizeHtml(html) {
|
|
37
|
+
if (!html) return '';
|
|
38
|
+
return html;
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
/**
|
|
@@ -4633,10 +4634,9 @@ async function copyPageTreeToClipboard(rootElement = null) {
|
|
|
4633
4634
|
// Expose API
|
|
4634
4635
|
global.CFPageTreeParser = {
|
|
4635
4636
|
parsePageTree,
|
|
4636
|
-
|
|
4637
|
-
extractPageSettings,
|
|
4637
|
+
createParseElement,
|
|
4638
4638
|
exportPageTreeJSON,
|
|
4639
|
-
|
|
4639
|
+
downloadPageTree,
|
|
4640
4640
|
copyPageTreeToClipboard,
|
|
4641
4641
|
// Utils
|
|
4642
4642
|
generateId,
|
package/package.json
CHANGED
package/src/utils.js
CHANGED
|
@@ -8,26 +8,12 @@
|
|
|
8
8
|
* ============================================================================
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
// Use DOMPurify in browser, simple passthrough on server
|
|
12
|
-
// Server-side parsing is from trusted FunnelWind source
|
|
13
|
-
let DOMPurify = null;
|
|
14
|
-
if (typeof window !== 'undefined') {
|
|
15
|
-
import('dompurify').then(mod => { DOMPurify = mod.default; });
|
|
16
|
-
}
|
|
17
|
-
|
|
18
11
|
/**
|
|
19
|
-
* Sanitize HTML
|
|
20
|
-
* Allows only safe formatting tags for text content
|
|
12
|
+
* Sanitize HTML - passthrough for trusted FunnelWind source content
|
|
21
13
|
*/
|
|
22
14
|
export function sanitizeHtml(html) {
|
|
23
15
|
if (!html) return '';
|
|
24
|
-
|
|
25
|
-
// (server-side parsing is from trusted FunnelWind source)
|
|
26
|
-
if (!DOMPurify) return html;
|
|
27
|
-
return DOMPurify.sanitize(html, {
|
|
28
|
-
ALLOWED_TAGS: ['b', 'strong', 'i', 'em', 'u', 's', 'strike', 'a', 'br', 'span', 'li'],
|
|
29
|
-
ALLOWED_ATTR: ['href', 'target', 'rel', 'style', 'class'],
|
|
30
|
-
});
|
|
16
|
+
return html;
|
|
31
17
|
}
|
|
32
18
|
|
|
33
19
|
/**
|