marko 6.0.163 → 6.0.165
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/debug/dom.js +3 -3
- package/dist/debug/dom.mjs +3 -3
- package/dist/debug/html.js +13 -5
- package/dist/debug/html.mjs +12 -5
- package/dist/dom.js +3 -3
- package/dist/dom.mjs +3 -3
- package/dist/html/content.d.ts +1 -0
- package/dist/html.d.ts +1 -1
- package/dist/html.js +12 -5
- package/dist/html.mjs +11 -5
- package/dist/translator/index.js +9 -3
- package/dist/translator/util/runtime.d.ts +2 -1
- package/package.json +1 -1
package/dist/debug/dom.js
CHANGED
|
@@ -413,7 +413,7 @@ function skipScope() {
|
|
|
413
413
|
}
|
|
414
414
|
function findBranchWithKey(scope, key) {
|
|
415
415
|
let branch = scope["#ClosestBranch" /* ClosestBranch */];
|
|
416
|
-
while (branch &&
|
|
416
|
+
while (branch && branch[key] == null) {
|
|
417
417
|
branch = branch["#ParentBranch" /* ParentBranch */];
|
|
418
418
|
}
|
|
419
419
|
return branch;
|
|
@@ -1941,7 +1941,7 @@ function _try(nodeAccessor, template, walks, setup) {
|
|
|
1941
1941
|
const branch = scope[branchAccessor];
|
|
1942
1942
|
if (branch) {
|
|
1943
1943
|
branch["#BranchAccessor" /* BranchAccessor */] = nodeAccessor;
|
|
1944
|
-
branch["#CatchContent" /* CatchContent */] = normalizeDynamicRenderer(input.catch);
|
|
1944
|
+
branch["#CatchContent" /* CatchContent */] = input.catch && (normalizeDynamicRenderer(input.catch) || 0);
|
|
1945
1945
|
branch["#PlaceholderContent" /* PlaceholderContent */] = normalizeDynamicRenderer(
|
|
1946
1946
|
input.placeholder
|
|
1947
1947
|
);
|
|
@@ -1968,7 +1968,7 @@ function renderCatch(scope, error) {
|
|
|
1968
1968
|
tryWithCatch["#CatchContent" /* CatchContent */],
|
|
1969
1969
|
createAndSetupBranch
|
|
1970
1970
|
);
|
|
1971
|
-
tryWithCatch["#CatchContent" /* CatchContent */]
|
|
1971
|
+
tryWithCatch["#CatchContent" /* CatchContent */]?.___params?.(
|
|
1972
1972
|
owner["BranchScopes:" /* BranchScopes */ + tryWithCatch["#BranchAccessor" /* BranchAccessor */]],
|
|
1973
1973
|
[error]
|
|
1974
1974
|
);
|
package/dist/debug/dom.mjs
CHANGED
|
@@ -297,7 +297,7 @@ function skipScope() {
|
|
|
297
297
|
}
|
|
298
298
|
function findBranchWithKey(scope, key) {
|
|
299
299
|
let branch = scope["#ClosestBranch" /* ClosestBranch */];
|
|
300
|
-
while (branch &&
|
|
300
|
+
while (branch && branch[key] == null) {
|
|
301
301
|
branch = branch["#ParentBranch" /* ParentBranch */];
|
|
302
302
|
}
|
|
303
303
|
return branch;
|
|
@@ -1825,7 +1825,7 @@ function _try(nodeAccessor, template, walks, setup) {
|
|
|
1825
1825
|
const branch = scope[branchAccessor];
|
|
1826
1826
|
if (branch) {
|
|
1827
1827
|
branch["#BranchAccessor" /* BranchAccessor */] = nodeAccessor;
|
|
1828
|
-
branch["#CatchContent" /* CatchContent */] = normalizeDynamicRenderer(input.catch);
|
|
1828
|
+
branch["#CatchContent" /* CatchContent */] = input.catch && (normalizeDynamicRenderer(input.catch) || 0);
|
|
1829
1829
|
branch["#PlaceholderContent" /* PlaceholderContent */] = normalizeDynamicRenderer(
|
|
1830
1830
|
input.placeholder
|
|
1831
1831
|
);
|
|
@@ -1852,7 +1852,7 @@ function renderCatch(scope, error) {
|
|
|
1852
1852
|
tryWithCatch["#CatchContent" /* CatchContent */],
|
|
1853
1853
|
createAndSetupBranch
|
|
1854
1854
|
);
|
|
1855
|
-
tryWithCatch["#CatchContent" /* CatchContent */]
|
|
1855
|
+
tryWithCatch["#CatchContent" /* CatchContent */]?.___params?.(
|
|
1856
1856
|
owner["BranchScopes:" /* BranchScopes */ + tryWithCatch["#BranchAccessor" /* BranchAccessor */]],
|
|
1857
1857
|
[error]
|
|
1858
1858
|
);
|
package/dist/debug/html.js
CHANGED
|
@@ -47,6 +47,7 @@ __export(html_exports, {
|
|
|
47
47
|
_el_read_error: () => _el_read_error,
|
|
48
48
|
_el_resume: () => _el_resume,
|
|
49
49
|
_escape: () => _escape,
|
|
50
|
+
_escape_comment: () => _escape_comment,
|
|
50
51
|
_escape_script: () => _escape_script,
|
|
51
52
|
_escape_style: () => _escape_style,
|
|
52
53
|
_existing_scope: () => _existing_scope,
|
|
@@ -256,16 +257,21 @@ var escapeXMLStr = (str) => unsafeXMLReg.test(str) ? str.replace(unsafeXMLReg, r
|
|
|
256
257
|
function _escape(val) {
|
|
257
258
|
return val ? escapeXMLStr(val + "") : val === 0 ? "0" : "";
|
|
258
259
|
}
|
|
259
|
-
var unsafeScriptReg = /<\/script/
|
|
260
|
+
var unsafeScriptReg = /<\/script/gi;
|
|
260
261
|
var escapeScriptStr = (str) => unsafeScriptReg.test(str) ? str.replace(unsafeScriptReg, "\\x3C/script") : str;
|
|
261
262
|
function _escape_script(val) {
|
|
262
263
|
return val ? escapeScriptStr(val + "") : val === 0 ? "0" : "";
|
|
263
264
|
}
|
|
264
|
-
var unsafeStyleReg = /<\/style/
|
|
265
|
+
var unsafeStyleReg = /<\/style/gi;
|
|
265
266
|
var escapeStyleStr = (str) => unsafeStyleReg.test(str) ? str.replace(unsafeStyleReg, "\\3C/style") : str;
|
|
266
267
|
function _escape_style(val) {
|
|
267
268
|
return val ? escapeStyleStr(val + "") : val === 0 ? "0" : "";
|
|
268
269
|
}
|
|
270
|
+
var unsafeCommentReg = />/g;
|
|
271
|
+
var escapeCommentStr = (str) => unsafeCommentReg.test(str) ? str.replace(unsafeCommentReg, ">") : str;
|
|
272
|
+
function _escape_comment(val) {
|
|
273
|
+
return val ? escapeCommentStr(val + "") : val === 0 ? "0" : "";
|
|
274
|
+
}
|
|
269
275
|
|
|
270
276
|
// src/common/for.ts
|
|
271
277
|
function forIn(obj, cb) {
|
|
@@ -2354,12 +2360,13 @@ function _await(scopeId, accessor, promise, content, serializeMarker) {
|
|
|
2354
2360
|
function _try(scopeId, accessor, content, input) {
|
|
2355
2361
|
const branchId = _peek_scope_id();
|
|
2356
2362
|
$chunk.writeHTML($chunk.boundary.state.mark("[" /* BranchStart */, ""));
|
|
2357
|
-
const catchContent = normalizeDynamicRenderer(input.catch);
|
|
2363
|
+
const catchContent = input.catch ? normalizeDynamicRenderer(input.catch) || 0 : void 0;
|
|
2358
2364
|
const placeholderContent = normalizeDynamicRenderer(input.placeholder);
|
|
2359
|
-
if (catchContent) {
|
|
2365
|
+
if (catchContent !== void 0) {
|
|
2360
2366
|
tryCatch(
|
|
2361
2367
|
placeholderContent ? () => tryPlaceholder(content, placeholderContent, branchId) : content,
|
|
2362
|
-
catchContent
|
|
2368
|
+
catchContent || (() => {
|
|
2369
|
+
})
|
|
2363
2370
|
);
|
|
2364
2371
|
} else if (placeholderContent) {
|
|
2365
2372
|
tryPlaceholder(content, placeholderContent, branchId);
|
|
@@ -3764,6 +3771,7 @@ function NOOP3() {
|
|
|
3764
3771
|
_el_read_error,
|
|
3765
3772
|
_el_resume,
|
|
3766
3773
|
_escape,
|
|
3774
|
+
_escape_comment,
|
|
3767
3775
|
_escape_script,
|
|
3768
3776
|
_escape_style,
|
|
3769
3777
|
_existing_scope,
|
package/dist/debug/html.mjs
CHANGED
|
@@ -164,16 +164,21 @@ var escapeXMLStr = (str) => unsafeXMLReg.test(str) ? str.replace(unsafeXMLReg, r
|
|
|
164
164
|
function _escape(val) {
|
|
165
165
|
return val ? escapeXMLStr(val + "") : val === 0 ? "0" : "";
|
|
166
166
|
}
|
|
167
|
-
var unsafeScriptReg = /<\/script/
|
|
167
|
+
var unsafeScriptReg = /<\/script/gi;
|
|
168
168
|
var escapeScriptStr = (str) => unsafeScriptReg.test(str) ? str.replace(unsafeScriptReg, "\\x3C/script") : str;
|
|
169
169
|
function _escape_script(val) {
|
|
170
170
|
return val ? escapeScriptStr(val + "") : val === 0 ? "0" : "";
|
|
171
171
|
}
|
|
172
|
-
var unsafeStyleReg = /<\/style/
|
|
172
|
+
var unsafeStyleReg = /<\/style/gi;
|
|
173
173
|
var escapeStyleStr = (str) => unsafeStyleReg.test(str) ? str.replace(unsafeStyleReg, "\\3C/style") : str;
|
|
174
174
|
function _escape_style(val) {
|
|
175
175
|
return val ? escapeStyleStr(val + "") : val === 0 ? "0" : "";
|
|
176
176
|
}
|
|
177
|
+
var unsafeCommentReg = />/g;
|
|
178
|
+
var escapeCommentStr = (str) => unsafeCommentReg.test(str) ? str.replace(unsafeCommentReg, ">") : str;
|
|
179
|
+
function _escape_comment(val) {
|
|
180
|
+
return val ? escapeCommentStr(val + "") : val === 0 ? "0" : "";
|
|
181
|
+
}
|
|
177
182
|
|
|
178
183
|
// src/common/for.ts
|
|
179
184
|
function forIn(obj, cb) {
|
|
@@ -2262,12 +2267,13 @@ function _await(scopeId, accessor, promise, content, serializeMarker) {
|
|
|
2262
2267
|
function _try(scopeId, accessor, content, input) {
|
|
2263
2268
|
const branchId = _peek_scope_id();
|
|
2264
2269
|
$chunk.writeHTML($chunk.boundary.state.mark("[" /* BranchStart */, ""));
|
|
2265
|
-
const catchContent = normalizeDynamicRenderer(input.catch);
|
|
2270
|
+
const catchContent = input.catch ? normalizeDynamicRenderer(input.catch) || 0 : void 0;
|
|
2266
2271
|
const placeholderContent = normalizeDynamicRenderer(input.placeholder);
|
|
2267
|
-
if (catchContent) {
|
|
2272
|
+
if (catchContent !== void 0) {
|
|
2268
2273
|
tryCatch(
|
|
2269
2274
|
placeholderContent ? () => tryPlaceholder(content, placeholderContent, branchId) : content,
|
|
2270
|
-
catchContent
|
|
2275
|
+
catchContent || (() => {
|
|
2276
|
+
})
|
|
2271
2277
|
);
|
|
2272
2278
|
} else if (placeholderContent) {
|
|
2273
2279
|
tryPlaceholder(content, placeholderContent, branchId);
|
|
@@ -3671,6 +3677,7 @@ export {
|
|
|
3671
3677
|
_el_read_error,
|
|
3672
3678
|
_el_resume,
|
|
3673
3679
|
_escape,
|
|
3680
|
+
_escape_comment,
|
|
3674
3681
|
_escape_script,
|
|
3675
3682
|
_escape_style,
|
|
3676
3683
|
_existing_scope,
|
package/dist/dom.js
CHANGED
|
@@ -267,7 +267,7 @@ function skipScope() {
|
|
|
267
267
|
}
|
|
268
268
|
function findBranchWithKey(scope, key) {
|
|
269
269
|
let branch = scope.F;
|
|
270
|
-
for (; branch &&
|
|
270
|
+
for (; branch && branch[key] == null; )
|
|
271
271
|
branch = branch.N;
|
|
272
272
|
return branch;
|
|
273
273
|
}
|
|
@@ -1216,7 +1216,7 @@ function _try(nodeAccessor, template, walks, setup) {
|
|
|
1216
1216
|
createAndSetupBranch
|
|
1217
1217
|
);
|
|
1218
1218
|
let branch = scope[branchAccessor];
|
|
1219
|
-
branch && (branch.C = nodeAccessor, branch.E = normalizeDynamicRenderer(input.catch), branch.Q = normalizeDynamicRenderer(
|
|
1219
|
+
branch && (branch.C = nodeAccessor, branch.E = input.catch && (normalizeDynamicRenderer(input.catch) || 0), branch.Q = normalizeDynamicRenderer(
|
|
1220
1220
|
input.placeholder
|
|
1221
1221
|
));
|
|
1222
1222
|
};
|
|
@@ -1230,7 +1230,7 @@ function renderCatch(scope, error) {
|
|
|
1230
1230
|
tryWithCatch.C,
|
|
1231
1231
|
tryWithCatch.E,
|
|
1232
1232
|
createAndSetupBranch
|
|
1233
|
-
), tryWithCatch.E
|
|
1233
|
+
), tryWithCatch.E?.d?.(
|
|
1234
1234
|
owner["A" /* BranchScopes */ + tryWithCatch.C],
|
|
1235
1235
|
[error]
|
|
1236
1236
|
);
|
package/dist/dom.mjs
CHANGED
|
@@ -154,7 +154,7 @@ function skipScope() {
|
|
|
154
154
|
}
|
|
155
155
|
function findBranchWithKey(scope, key) {
|
|
156
156
|
let branch = scope.F;
|
|
157
|
-
for (; branch &&
|
|
157
|
+
for (; branch && branch[key] == null; )
|
|
158
158
|
branch = branch.N;
|
|
159
159
|
return branch;
|
|
160
160
|
}
|
|
@@ -1103,7 +1103,7 @@ function _try(nodeAccessor, template, walks, setup) {
|
|
|
1103
1103
|
createAndSetupBranch
|
|
1104
1104
|
);
|
|
1105
1105
|
let branch = scope[branchAccessor];
|
|
1106
|
-
branch && (branch.C = nodeAccessor, branch.E = normalizeDynamicRenderer(input.catch), branch.Q = normalizeDynamicRenderer(
|
|
1106
|
+
branch && (branch.C = nodeAccessor, branch.E = input.catch && (normalizeDynamicRenderer(input.catch) || 0), branch.Q = normalizeDynamicRenderer(
|
|
1107
1107
|
input.placeholder
|
|
1108
1108
|
));
|
|
1109
1109
|
};
|
|
@@ -1117,7 +1117,7 @@ function renderCatch(scope, error) {
|
|
|
1117
1117
|
tryWithCatch.C,
|
|
1118
1118
|
tryWithCatch.E,
|
|
1119
1119
|
createAndSetupBranch
|
|
1120
|
-
), tryWithCatch.E
|
|
1120
|
+
), tryWithCatch.E?.d?.(
|
|
1121
1121
|
owner["A" /* BranchScopes */ + tryWithCatch.C],
|
|
1122
1122
|
[error]
|
|
1123
1123
|
);
|
package/dist/html/content.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ export declare function _unescaped(val: unknown): string;
|
|
|
2
2
|
export declare function _escape(val: unknown): string;
|
|
3
3
|
export declare function _escape_script(val: unknown): string;
|
|
4
4
|
export declare function _escape_style(val: unknown): string;
|
|
5
|
+
export declare function _escape_comment(val: unknown): string;
|
package/dist/html.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { attrTag, attrTags } from "./common/attr-tag";
|
|
|
2
2
|
export { _assert_hoist, _el_read_error, _hoist_read_error, } from "./common/errors";
|
|
3
3
|
export { _attr, _attr_class, _attr_details_or_dialog_open as _attr_details_open, _attr_details_or_dialog_open as _attr_dialog_open, _attr_input_checked, _attr_input_checkedValue, _attr_input_value, _attr_nonce, _attr_option_value, _attr_select_value, _attr_style, _attr_textarea_value, _attrs, _attrs_content, _attrs_partial, _attrs_partial_content, } from "./html/attrs";
|
|
4
4
|
export { compat } from "./html/compat";
|
|
5
|
-
export { _escape, _escape_script, _escape_style, _unescaped, } from "./html/content";
|
|
5
|
+
export { _escape, _escape_comment, _escape_script, _escape_style, _unescaped, } from "./html/content";
|
|
6
6
|
export { _content, _content_resume, _dynamic_tag } from "./html/dynamic-tag";
|
|
7
7
|
export { forIn, forInBy, forOf, forOfBy, forStepBy, forTo, forUntil, } from "./html/for";
|
|
8
8
|
export { _template } from "./html/template";
|
package/dist/html.js
CHANGED
|
@@ -44,6 +44,7 @@ __export(html_exports, {
|
|
|
44
44
|
_el_read_error: () => _el_read_error,
|
|
45
45
|
_el_resume: () => _el_resume,
|
|
46
46
|
_escape: () => _escape,
|
|
47
|
+
_escape_comment: () => _escape_comment,
|
|
47
48
|
_escape_script: () => _escape_script,
|
|
48
49
|
_escape_style: () => _escape_style,
|
|
49
50
|
_existing_scope: () => _existing_scope,
|
|
@@ -159,14 +160,18 @@ var unsafeXMLReg = /[<&]/g, replaceUnsafeXML = (c) => c === "&" ? "&" : "<
|
|
|
159
160
|
function _escape(val) {
|
|
160
161
|
return val ? escapeXMLStr(val + "") : val === 0 ? "0" : "";
|
|
161
162
|
}
|
|
162
|
-
var unsafeScriptReg = /<\/script/
|
|
163
|
+
var unsafeScriptReg = /<\/script/gi, escapeScriptStr = (str) => unsafeScriptReg.test(str) ? str.replace(unsafeScriptReg, "\\x3C/script") : str;
|
|
163
164
|
function _escape_script(val) {
|
|
164
165
|
return val ? escapeScriptStr(val + "") : val === 0 ? "0" : "";
|
|
165
166
|
}
|
|
166
|
-
var unsafeStyleReg = /<\/style/
|
|
167
|
+
var unsafeStyleReg = /<\/style/gi, escapeStyleStr = (str) => unsafeStyleReg.test(str) ? str.replace(unsafeStyleReg, "\\3C/style") : str;
|
|
167
168
|
function _escape_style(val) {
|
|
168
169
|
return val ? escapeStyleStr(val + "") : val === 0 ? "0" : "";
|
|
169
170
|
}
|
|
171
|
+
var unsafeCommentReg = />/g, escapeCommentStr = (str) => unsafeCommentReg.test(str) ? str.replace(unsafeCommentReg, ">") : str;
|
|
172
|
+
function _escape_comment(val) {
|
|
173
|
+
return val ? escapeCommentStr(val + "") : val === 0 ? "0" : "";
|
|
174
|
+
}
|
|
170
175
|
|
|
171
176
|
// src/common/for.ts
|
|
172
177
|
function forIn(obj, cb) {
|
|
@@ -1474,10 +1479,11 @@ function _await(scopeId, accessor, promise, content, serializeMarker) {
|
|
|
1474
1479
|
function _try(scopeId, accessor, content, input) {
|
|
1475
1480
|
let branchId = _peek_scope_id();
|
|
1476
1481
|
$chunk.writeHTML($chunk.boundary.state.mark("[" /* BranchStart */, ""));
|
|
1477
|
-
let catchContent = normalizeDynamicRenderer(input.catch), placeholderContent = normalizeDynamicRenderer(input.placeholder);
|
|
1478
|
-
catchContent ? tryCatch(
|
|
1482
|
+
let catchContent = input.catch ? normalizeDynamicRenderer(input.catch) || 0 : void 0, placeholderContent = normalizeDynamicRenderer(input.placeholder);
|
|
1483
|
+
catchContent !== void 0 ? tryCatch(
|
|
1479
1484
|
placeholderContent ? () => tryPlaceholder(content, placeholderContent, branchId) : content,
|
|
1480
|
-
catchContent
|
|
1485
|
+
catchContent || (() => {
|
|
1486
|
+
})
|
|
1481
1487
|
) : placeholderContent ? tryPlaceholder(content, placeholderContent, branchId) : content(), writeScope(branchId, {
|
|
1482
1488
|
C: accessor,
|
|
1483
1489
|
E: catchContent,
|
|
@@ -2394,6 +2400,7 @@ function NOOP3() {
|
|
|
2394
2400
|
_el_read_error,
|
|
2395
2401
|
_el_resume,
|
|
2396
2402
|
_escape,
|
|
2403
|
+
_escape_comment,
|
|
2397
2404
|
_escape_script,
|
|
2398
2405
|
_escape_style,
|
|
2399
2406
|
_existing_scope,
|
package/dist/html.mjs
CHANGED
|
@@ -70,14 +70,18 @@ var unsafeXMLReg = /[<&]/g, replaceUnsafeXML = (c) => c === "&" ? "&" : "<
|
|
|
70
70
|
function _escape(val) {
|
|
71
71
|
return val ? escapeXMLStr(val + "") : val === 0 ? "0" : "";
|
|
72
72
|
}
|
|
73
|
-
var unsafeScriptReg = /<\/script/
|
|
73
|
+
var unsafeScriptReg = /<\/script/gi, escapeScriptStr = (str) => unsafeScriptReg.test(str) ? str.replace(unsafeScriptReg, "\\x3C/script") : str;
|
|
74
74
|
function _escape_script(val) {
|
|
75
75
|
return val ? escapeScriptStr(val + "") : val === 0 ? "0" : "";
|
|
76
76
|
}
|
|
77
|
-
var unsafeStyleReg = /<\/style/
|
|
77
|
+
var unsafeStyleReg = /<\/style/gi, escapeStyleStr = (str) => unsafeStyleReg.test(str) ? str.replace(unsafeStyleReg, "\\3C/style") : str;
|
|
78
78
|
function _escape_style(val) {
|
|
79
79
|
return val ? escapeStyleStr(val + "") : val === 0 ? "0" : "";
|
|
80
80
|
}
|
|
81
|
+
var unsafeCommentReg = />/g, escapeCommentStr = (str) => unsafeCommentReg.test(str) ? str.replace(unsafeCommentReg, ">") : str;
|
|
82
|
+
function _escape_comment(val) {
|
|
83
|
+
return val ? escapeCommentStr(val + "") : val === 0 ? "0" : "";
|
|
84
|
+
}
|
|
81
85
|
|
|
82
86
|
// src/common/for.ts
|
|
83
87
|
function forIn(obj, cb) {
|
|
@@ -1385,10 +1389,11 @@ function _await(scopeId, accessor, promise, content, serializeMarker) {
|
|
|
1385
1389
|
function _try(scopeId, accessor, content, input) {
|
|
1386
1390
|
let branchId = _peek_scope_id();
|
|
1387
1391
|
$chunk.writeHTML($chunk.boundary.state.mark("[" /* BranchStart */, ""));
|
|
1388
|
-
let catchContent = normalizeDynamicRenderer(input.catch), placeholderContent = normalizeDynamicRenderer(input.placeholder);
|
|
1389
|
-
catchContent ? tryCatch(
|
|
1392
|
+
let catchContent = input.catch ? normalizeDynamicRenderer(input.catch) || 0 : void 0, placeholderContent = normalizeDynamicRenderer(input.placeholder);
|
|
1393
|
+
catchContent !== void 0 ? tryCatch(
|
|
1390
1394
|
placeholderContent ? () => tryPlaceholder(content, placeholderContent, branchId) : content,
|
|
1391
|
-
catchContent
|
|
1395
|
+
catchContent || (() => {
|
|
1396
|
+
})
|
|
1392
1397
|
) : placeholderContent ? tryPlaceholder(content, placeholderContent, branchId) : content(), writeScope(branchId, {
|
|
1393
1398
|
C: accessor,
|
|
1394
1399
|
E: catchContent,
|
|
@@ -2304,6 +2309,7 @@ export {
|
|
|
2304
2309
|
_el_read_error,
|
|
2305
2310
|
_el_resume,
|
|
2306
2311
|
_escape,
|
|
2312
|
+
_escape_comment,
|
|
2307
2313
|
_escape_script,
|
|
2308
2314
|
_escape_style,
|
|
2309
2315
|
_existing_scope,
|
package/dist/translator/index.js
CHANGED
|
@@ -2377,16 +2377,21 @@ var escapeXMLStr = (str) => unsafeXMLReg.test(str) ? str.replace(unsafeXMLReg, r
|
|
|
2377
2377
|
function _escape(val) {
|
|
2378
2378
|
return val ? escapeXMLStr(val + "") : val === 0 ? "0" : "";
|
|
2379
2379
|
}
|
|
2380
|
-
var unsafeScriptReg = /<\/script/
|
|
2380
|
+
var unsafeScriptReg = /<\/script/gi;
|
|
2381
2381
|
var escapeScriptStr = (str) => unsafeScriptReg.test(str) ? str.replace(unsafeScriptReg, "\\x3C/script") : str;
|
|
2382
2382
|
function _escape_script(val) {
|
|
2383
2383
|
return val ? escapeScriptStr(val + "") : val === 0 ? "0" : "";
|
|
2384
2384
|
}
|
|
2385
|
-
var unsafeStyleReg = /<\/style/
|
|
2385
|
+
var unsafeStyleReg = /<\/style/gi;
|
|
2386
2386
|
var escapeStyleStr = (str) => unsafeStyleReg.test(str) ? str.replace(unsafeStyleReg, "\\3C/style") : str;
|
|
2387
2387
|
function _escape_style(val) {
|
|
2388
2388
|
return val ? escapeStyleStr(val + "") : val === 0 ? "0" : "";
|
|
2389
2389
|
}
|
|
2390
|
+
var unsafeCommentReg = />/g;
|
|
2391
|
+
var escapeCommentStr = (str) => unsafeCommentReg.test(str) ? str.replace(unsafeCommentReg, ">") : str;
|
|
2392
|
+
function _escape_comment(val) {
|
|
2393
|
+
return val ? escapeCommentStr(val + "") : val === 0 ? "0" : "";
|
|
2394
|
+
}
|
|
2390
2395
|
|
|
2391
2396
|
// src/html/writer.ts
|
|
2392
2397
|
if (false) {
|
|
@@ -2530,6 +2535,7 @@ function callRuntime(name2, ...args) {
|
|
|
2530
2535
|
function getHTMLRuntime() {
|
|
2531
2536
|
return {
|
|
2532
2537
|
_escape,
|
|
2538
|
+
_escape_comment,
|
|
2533
2539
|
_unescaped,
|
|
2534
2540
|
_attr,
|
|
2535
2541
|
_attr_class,
|
|
@@ -10827,7 +10833,7 @@ var html_comment_default = {
|
|
|
10827
10833
|
if (import_compiler45.types.isMarkoText(child)) {
|
|
10828
10834
|
write`${child.value}`;
|
|
10829
10835
|
} else if (import_compiler45.types.isMarkoPlaceholder(child)) {
|
|
10830
|
-
write`${callRuntime("
|
|
10836
|
+
write`${callRuntime(child.escape ? "_escape_comment" : "_unescaped", child.value)}`;
|
|
10831
10837
|
}
|
|
10832
10838
|
}
|
|
10833
10839
|
} else {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
2
|
import type { Falsy } from "../../common/types";
|
|
3
|
-
import { _attr, _attr_class, _attr_style, _escape, _escape_script, _escape_style, _unescaped } from "../../html";
|
|
3
|
+
import { _attr, _attr_class, _attr_style, _escape, _escape_comment, _escape_script, _escape_style, _unescaped } from "../../html";
|
|
4
4
|
export type DOMRuntimeHelpers = keyof typeof import("../../dom");
|
|
5
5
|
export type HTMLRuntimeHelpers = keyof typeof import("../../html");
|
|
6
6
|
export declare function importRuntime(name: DOMRuntimeHelpers | HTMLRuntimeHelpers): t.MemberExpression;
|
|
7
7
|
export declare function callRuntime(name: DOMRuntimeHelpers | HTMLRuntimeHelpers, ...args: Array<Parameters<typeof t.callExpression>[1][number] | Falsy>): t.CallExpression;
|
|
8
8
|
export declare function getHTMLRuntime(): {
|
|
9
9
|
_escape: typeof _escape;
|
|
10
|
+
_escape_comment: typeof _escape_comment;
|
|
10
11
|
_unescaped: typeof _unescaped;
|
|
11
12
|
_attr: typeof _attr;
|
|
12
13
|
_attr_class: typeof _attr_class;
|