marko 5.39.47 → 5.39.48
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.
|
@@ -4,6 +4,8 @@ var notEmptyAttr = attrHelper.bC_;
|
|
|
4
4
|
var isEmptyAttrValue = attrHelper.bD_;
|
|
5
5
|
var classHelper = require("./class-attr");
|
|
6
6
|
var styleHelper = require("./style-attr");
|
|
7
|
+
// Characters that end or break an attribute name in the HTML parser.
|
|
8
|
+
var invalidAttrNameReg = /[\s/>"'=]/;
|
|
7
9
|
|
|
8
10
|
module.exports = function dynamicAttr(name, value) {
|
|
9
11
|
switch (name) {
|
|
@@ -14,22 +16,8 @@ module.exports = function dynamicAttr(name, value) {
|
|
|
14
16
|
case "renderBody":
|
|
15
17
|
return "";
|
|
16
18
|
default:
|
|
17
|
-
return isEmptyAttrValue(value) ||
|
|
19
|
+
return isEmptyAttrValue(value) || invalidAttrNameReg.test(name) ?
|
|
18
20
|
"" :
|
|
19
21
|
notEmptyAttr(name, value);
|
|
20
22
|
}
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
|
|
24
|
-
// Technically the above includes more invalid characters for attributes.
|
|
25
|
-
// In practice however the only character that does not become an attribute name
|
|
26
|
-
// is when there is a >.
|
|
27
|
-
function isInvalidAttrName(name) {
|
|
28
|
-
for (let i = name.length; i--;) {
|
|
29
|
-
if (name[i] === ">") {
|
|
30
|
-
return true;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
23
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "marko",
|
|
3
|
-
"version": "5.39.
|
|
3
|
+
"version": "5.39.48",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "UI Components + streaming, async, high performance, HTML templating for Node.js and the browser.",
|
|
6
6
|
"keywords": [
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
},
|
|
68
68
|
"types": "index.d.ts",
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@marko/compiler": "^5.42.
|
|
71
|
-
"@marko/runtime-tags": "^6.4.
|
|
70
|
+
"@marko/compiler": "^5.42.14",
|
|
71
|
+
"@marko/runtime-tags": "^6.4.8",
|
|
72
72
|
"app-module-path": "^2.2.0",
|
|
73
73
|
"argly": "^1.2.0",
|
|
74
74
|
"browser-refresh-client": "1.1.4",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"warp10": "^2.1.0"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
|
-
"marko": "5.39.
|
|
87
|
+
"marko": "5.39.48"
|
|
88
88
|
},
|
|
89
89
|
"engines": {
|
|
90
90
|
"node": ">=22"
|
|
@@ -4,6 +4,8 @@ var notEmptyAttr = attrHelper.___notEmptyAttr;
|
|
|
4
4
|
var isEmptyAttrValue = attrHelper.___isEmptyAttrValue;
|
|
5
5
|
var classHelper = require("./class-attr");
|
|
6
6
|
var styleHelper = require("./style-attr");
|
|
7
|
+
// Characters that end or break an attribute name in the HTML parser.
|
|
8
|
+
var invalidAttrNameReg = /[\s/>"'=]/;
|
|
7
9
|
|
|
8
10
|
module.exports = function dynamicAttr(name, value) {
|
|
9
11
|
switch (name) {
|
|
@@ -14,22 +16,8 @@ module.exports = function dynamicAttr(name, value) {
|
|
|
14
16
|
case "renderBody":
|
|
15
17
|
return "";
|
|
16
18
|
default:
|
|
17
|
-
return isEmptyAttrValue(value) ||
|
|
19
|
+
return isEmptyAttrValue(value) || invalidAttrNameReg.test(name)
|
|
18
20
|
? ""
|
|
19
21
|
: notEmptyAttr(name, value);
|
|
20
22
|
}
|
|
21
23
|
};
|
|
22
|
-
|
|
23
|
-
// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
|
|
24
|
-
// Technically the above includes more invalid characters for attributes.
|
|
25
|
-
// In practice however the only character that does not become an attribute name
|
|
26
|
-
// is when there is a >.
|
|
27
|
-
function isInvalidAttrName(name) {
|
|
28
|
-
for (let i = name.length; i--;) {
|
|
29
|
-
if (name[i] === ">") {
|
|
30
|
-
return true;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return false;
|
|
35
|
-
}
|