@useinsider/guido 3.23.0-beta.31d0f5f → 3.23.0-beta.668404b
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.
|
@@ -16,6 +16,8 @@ const x = /* @__PURE__ */ new Set([
|
|
|
16
16
|
"fix-tags-end",
|
|
17
17
|
// Unwrap translate-injected <font dir="auto"> tags — pure removal, never emits AMP-forbidden output.
|
|
18
18
|
"strip-font-tags",
|
|
19
|
+
// Trim whitespace inside href values — attribute-value edit only, emits nothing new.
|
|
20
|
+
"trim-href-whitespace",
|
|
19
21
|
// Image domain corrections — plain string replacement.
|
|
20
22
|
"replace-old-image-domain",
|
|
21
23
|
"replace-old-v2-image-domain",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { stripFontTags as
|
|
2
|
-
|
|
1
|
+
import { stripFontTags as c } from "../../utils/stripFontTags.js";
|
|
2
|
+
import { trimHrefWhitespace as l } from "../../utils/trimHrefWhitespace.js";
|
|
3
|
+
const f = [
|
|
3
4
|
{
|
|
4
5
|
id: "fix-url-encoding-start",
|
|
5
6
|
description: "Replace {%22 with %7B%22 to fix URL encoding",
|
|
@@ -58,9 +59,16 @@ const d = [
|
|
|
58
59
|
id: "strip-font-tags",
|
|
59
60
|
description: 'Unwrap browser-translate-injected <font dir="auto"> tags, keeping inner content; other <font> elements are left intact.',
|
|
60
61
|
type: "custom",
|
|
61
|
-
processor: (e) =>
|
|
62
|
+
processor: (e) => c(e),
|
|
62
63
|
priority: 15
|
|
63
64
|
},
|
|
65
|
+
{
|
|
66
|
+
id: "trim-href-whitespace",
|
|
67
|
+
description: "Trim leading/trailing whitespace and from every href value",
|
|
68
|
+
type: "custom",
|
|
69
|
+
processor: (e) => l(e),
|
|
70
|
+
priority: 16
|
|
71
|
+
},
|
|
64
72
|
{
|
|
65
73
|
id: "remove-apty-iframe",
|
|
66
74
|
description: "Cleanup Apty Iframe Code",
|
|
@@ -157,8 +165,8 @@ const d = [
|
|
|
157
165
|
processor: (e) => {
|
|
158
166
|
const t = (i) => i.toString(16).padStart(2, "0");
|
|
159
167
|
return e.replace(/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/gi, (i, o, n, r) => {
|
|
160
|
-
const [s, a,
|
|
161
|
-
return s > 255 || a > 255 ||
|
|
168
|
+
const [s, a, p] = [Number(o), Number(n), Number(r)];
|
|
169
|
+
return s > 255 || a > 255 || p > 255 ? i : `#${t(s)}${t(a)}${t(p)}`;
|
|
162
170
|
}).replace(/#([0-9a-f])\1([0-9a-f])\2([0-9a-f])\3\b/gi, "#$1$2$3");
|
|
163
171
|
},
|
|
164
172
|
priority: 44
|
|
@@ -200,5 +208,5 @@ const d = [
|
|
|
200
208
|
}
|
|
201
209
|
];
|
|
202
210
|
export {
|
|
203
|
-
|
|
211
|
+
f as defaultHtmlCompilerRules
|
|
204
212
|
};
|
package/dist/package.json.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const E = /(<[a-z][\w:-]*(?:\s[^>]*?)?\shref\s*=\s*)(["'])([\s\S]*?)\2/gi, c = /^(?:\s| | | )+|(?:\s| | | )+$/gi;
|
|
2
|
+
function a(e) {
|
|
3
|
+
return !e || !/href/i.test(e) ? e : e.replace(E, (i, s, r, n) => {
|
|
4
|
+
const t = n.replace(c, "");
|
|
5
|
+
return `${s}${r}${t}${r}`;
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
a as trimHrefWhitespace
|
|
10
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.23.0-beta.
|
|
3
|
+
"version": "3.23.0-beta.668404b",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|