@marianmeres/stuic 3.71.0 → 3.71.1
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.
|
@@ -109,18 +109,16 @@
|
|
|
109
109
|
|
|
110
110
|
onDestroy(clearTimers);
|
|
111
111
|
|
|
112
|
+
const HTML_ESCAPES: Record<string, string> = {
|
|
113
|
+
"&": "&",
|
|
114
|
+
"<": "<",
|
|
115
|
+
">": ">",
|
|
116
|
+
'"': """,
|
|
117
|
+
"'": "'",
|
|
118
|
+
};
|
|
119
|
+
|
|
112
120
|
function escapeHtml(s: string): string {
|
|
113
|
-
return s.replace(/[&<>"']/g, (c) =>
|
|
114
|
-
c === "&"
|
|
115
|
-
? "&"
|
|
116
|
-
: c === "<"
|
|
117
|
-
? "<"
|
|
118
|
-
: c === ">"
|
|
119
|
-
? ">"
|
|
120
|
-
: c === '"'
|
|
121
|
-
? """
|
|
122
|
-
: "'"
|
|
123
|
-
);
|
|
121
|
+
return s.replace(/[&<>"']/g, (c) => HTML_ESCAPES[c]);
|
|
124
122
|
}
|
|
125
123
|
|
|
126
124
|
let subheadingHtml = $derived(
|