squint-cljs 0.9.174 → 0.9.176

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
@@ -2,7 +2,7 @@
2
2
  "name": "squint-cljs",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.9.174",
5
+ "version": "0.9.176",
6
6
  "files": [
7
7
  "core.js",
8
8
  "src/squint/core.js",
@@ -16,12 +16,14 @@ export function html([s]) {
16
16
  }
17
17
 
18
18
  function escapeHTML(text) {
19
- return text.toString()
20
- .replace("&", "&")
21
- .replace("<", "&lt;")
22
- .replace(">", "&gt;")
23
- .replace("\"", "&quot;")
24
- .replace("'", "&apos;");
19
+ const map = {
20
+ "&": "&amp;",
21
+ "<": "&lt;",
22
+ ">": "&gt;",
23
+ '"': "&quot;",
24
+ "'": "&apos;"
25
+ };
26
+ return text.toString().replace(/[&<>"']/g, m => map[m]);
25
27
  }
26
28
 
27
29
  function safe(x) {
@@ -58,7 +60,7 @@ function attr(v) {
58
60
  }
59
61
 
60
62
  function toHTML(v, unsafe) {
61
- if (v == null) return;
63
+ if (v == null) return '';
62
64
  if (v instanceof Html) return v;
63
65
  if (typeof(v) === 'string') return unsafe ? v : safe(v);
64
66
  if (v[Symbol.iterator]) {