@inzombieland/nuxt-common 1.18.50 → 1.18.52
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/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
2
2
|
import { defineNuxtModule, createResolver, addServerHandler, addImportsDir, addPlugin, addComponent } from '@nuxt/kit';
|
|
3
3
|
|
|
4
4
|
const name = "@inzombieland/nuxt-common";
|
|
5
|
-
const version = "1.18.
|
|
5
|
+
const version = "1.18.52";
|
|
6
6
|
|
|
7
7
|
const module = defineNuxtModule({
|
|
8
8
|
meta: {
|
|
@@ -3,87 +3,86 @@ import sanitize from "ultrahtml/transformers/sanitize";
|
|
|
3
3
|
export function defineSanitizeHtmlPlugin(app) {
|
|
4
4
|
app.directive("sanitize-html", async (el, binding) => {
|
|
5
5
|
if (binding.value !== binding.oldValue) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
]);
|
|
6
|
+
const allowElements = [
|
|
7
|
+
"address",
|
|
8
|
+
"article",
|
|
9
|
+
"aside",
|
|
10
|
+
"footer",
|
|
11
|
+
"header",
|
|
12
|
+
"h1",
|
|
13
|
+
"h2",
|
|
14
|
+
"h3",
|
|
15
|
+
"h4",
|
|
16
|
+
"h5",
|
|
17
|
+
"h6",
|
|
18
|
+
"hgroup",
|
|
19
|
+
"main",
|
|
20
|
+
"nav",
|
|
21
|
+
"section",
|
|
22
|
+
"blockquote",
|
|
23
|
+
"dd",
|
|
24
|
+
"div",
|
|
25
|
+
"dl",
|
|
26
|
+
"dt",
|
|
27
|
+
"figcaption",
|
|
28
|
+
"figure",
|
|
29
|
+
"hr",
|
|
30
|
+
"li",
|
|
31
|
+
"main",
|
|
32
|
+
"ol",
|
|
33
|
+
"p",
|
|
34
|
+
"pre",
|
|
35
|
+
"ul",
|
|
36
|
+
"a",
|
|
37
|
+
"abbr",
|
|
38
|
+
"b",
|
|
39
|
+
"bdi",
|
|
40
|
+
"bdo",
|
|
41
|
+
"br",
|
|
42
|
+
"cite",
|
|
43
|
+
"code",
|
|
44
|
+
"data",
|
|
45
|
+
"dfn",
|
|
46
|
+
"em",
|
|
47
|
+
"i",
|
|
48
|
+
"kbd",
|
|
49
|
+
"mark",
|
|
50
|
+
"q",
|
|
51
|
+
"rb",
|
|
52
|
+
"rp",
|
|
53
|
+
"rt",
|
|
54
|
+
"rtc",
|
|
55
|
+
"ruby",
|
|
56
|
+
"s",
|
|
57
|
+
"samp",
|
|
58
|
+
"small",
|
|
59
|
+
"span",
|
|
60
|
+
"strong",
|
|
61
|
+
"sub",
|
|
62
|
+
"sup",
|
|
63
|
+
"time",
|
|
64
|
+
"u",
|
|
65
|
+
"var",
|
|
66
|
+
"wbr",
|
|
67
|
+
"caption",
|
|
68
|
+
"col",
|
|
69
|
+
"colgroup",
|
|
70
|
+
"table",
|
|
71
|
+
"tbody",
|
|
72
|
+
"td",
|
|
73
|
+
"tfoot",
|
|
74
|
+
"th",
|
|
75
|
+
"thead",
|
|
76
|
+
"tr"
|
|
77
|
+
];
|
|
78
|
+
const allowAttributes = {
|
|
79
|
+
a: ["href", "name", "target"],
|
|
80
|
+
img: ["src", "srcset", "alt", "title", "width", "height", "loading"]
|
|
81
|
+
};
|
|
82
|
+
if (!binding.modifiers.disallowimg) {
|
|
83
|
+
allowElements.push("img");
|
|
84
|
+
}
|
|
85
|
+
el.innerHTML = await transform(binding.value, [sanitize({ allowElements, allowAttributes })]);
|
|
87
86
|
}
|
|
88
87
|
});
|
|
89
88
|
}
|