@uniformdev/richtext 20.72.3-alpha.5 → 20.72.3-alpha.8
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/index.esm.js +8 -3
- package/dist/index.js +8 -3
- package/dist/index.mjs +8 -3
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -118,7 +118,7 @@ function linkParamValueToHtmlAttributes(link) {
|
|
|
118
118
|
var _a;
|
|
119
119
|
const result = {};
|
|
120
120
|
const href = linkParamValueToHref(link);
|
|
121
|
-
if (href
|
|
121
|
+
if (href) {
|
|
122
122
|
result.href = href;
|
|
123
123
|
}
|
|
124
124
|
if (!(link == null ? void 0 : link.attributes)) {
|
|
@@ -142,7 +142,9 @@ function linkParamValueToHtmlAttributes(link) {
|
|
|
142
142
|
}
|
|
143
143
|
result[key] = value;
|
|
144
144
|
}
|
|
145
|
-
|
|
145
|
+
const targetEntry = Object.entries(result).find(([key]) => key.toLowerCase() === "target");
|
|
146
|
+
const hasRel = Object.keys(result).some((key) => key.toLowerCase() === "rel");
|
|
147
|
+
if (((_a = targetEntry == null ? void 0 : targetEntry[1]) == null ? void 0 : _a.toLowerCase()) === "_blank" && !hasRel) {
|
|
146
148
|
result.rel = "noopener noreferrer";
|
|
147
149
|
}
|
|
148
150
|
return result;
|
|
@@ -166,8 +168,11 @@ function linkParamValueToHref(link) {
|
|
|
166
168
|
case "tel":
|
|
167
169
|
return `tel:${link.path}`;
|
|
168
170
|
case "url":
|
|
169
|
-
return link.path;
|
|
170
171
|
case "projectMapNode":
|
|
172
|
+
if (hasDangerousScheme(link.path)) {
|
|
173
|
+
console.warn(`[richtext] Dropped disallowed link URL scheme: "${link.path}"`);
|
|
174
|
+
return void 0;
|
|
175
|
+
}
|
|
171
176
|
return link.path;
|
|
172
177
|
}
|
|
173
178
|
}
|
package/dist/index.js
CHANGED
|
@@ -184,7 +184,7 @@ function linkParamValueToHtmlAttributes(link) {
|
|
|
184
184
|
var _a;
|
|
185
185
|
const result = {};
|
|
186
186
|
const href = linkParamValueToHref(link);
|
|
187
|
-
if (href
|
|
187
|
+
if (href) {
|
|
188
188
|
result.href = href;
|
|
189
189
|
}
|
|
190
190
|
if (!(link == null ? void 0 : link.attributes)) {
|
|
@@ -208,7 +208,9 @@ function linkParamValueToHtmlAttributes(link) {
|
|
|
208
208
|
}
|
|
209
209
|
result[key] = value;
|
|
210
210
|
}
|
|
211
|
-
|
|
211
|
+
const targetEntry = Object.entries(result).find(([key]) => key.toLowerCase() === "target");
|
|
212
|
+
const hasRel = Object.keys(result).some((key) => key.toLowerCase() === "rel");
|
|
213
|
+
if (((_a = targetEntry == null ? void 0 : targetEntry[1]) == null ? void 0 : _a.toLowerCase()) === "_blank" && !hasRel) {
|
|
212
214
|
result.rel = "noopener noreferrer";
|
|
213
215
|
}
|
|
214
216
|
return result;
|
|
@@ -232,8 +234,11 @@ function linkParamValueToHref(link) {
|
|
|
232
234
|
case "tel":
|
|
233
235
|
return `tel:${link.path}`;
|
|
234
236
|
case "url":
|
|
235
|
-
return link.path;
|
|
236
237
|
case "projectMapNode":
|
|
238
|
+
if (hasDangerousScheme(link.path)) {
|
|
239
|
+
console.warn(`[richtext] Dropped disallowed link URL scheme: "${link.path}"`);
|
|
240
|
+
return void 0;
|
|
241
|
+
}
|
|
237
242
|
return link.path;
|
|
238
243
|
}
|
|
239
244
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -118,7 +118,7 @@ function linkParamValueToHtmlAttributes(link) {
|
|
|
118
118
|
var _a;
|
|
119
119
|
const result = {};
|
|
120
120
|
const href = linkParamValueToHref(link);
|
|
121
|
-
if (href
|
|
121
|
+
if (href) {
|
|
122
122
|
result.href = href;
|
|
123
123
|
}
|
|
124
124
|
if (!(link == null ? void 0 : link.attributes)) {
|
|
@@ -142,7 +142,9 @@ function linkParamValueToHtmlAttributes(link) {
|
|
|
142
142
|
}
|
|
143
143
|
result[key] = value;
|
|
144
144
|
}
|
|
145
|
-
|
|
145
|
+
const targetEntry = Object.entries(result).find(([key]) => key.toLowerCase() === "target");
|
|
146
|
+
const hasRel = Object.keys(result).some((key) => key.toLowerCase() === "rel");
|
|
147
|
+
if (((_a = targetEntry == null ? void 0 : targetEntry[1]) == null ? void 0 : _a.toLowerCase()) === "_blank" && !hasRel) {
|
|
146
148
|
result.rel = "noopener noreferrer";
|
|
147
149
|
}
|
|
148
150
|
return result;
|
|
@@ -166,8 +168,11 @@ function linkParamValueToHref(link) {
|
|
|
166
168
|
case "tel":
|
|
167
169
|
return `tel:${link.path}`;
|
|
168
170
|
case "url":
|
|
169
|
-
return link.path;
|
|
170
171
|
case "projectMapNode":
|
|
172
|
+
if (hasDangerousScheme(link.path)) {
|
|
173
|
+
console.warn(`[richtext] Dropped disallowed link URL scheme: "${link.path}"`);
|
|
174
|
+
return void 0;
|
|
175
|
+
}
|
|
171
176
|
return link.path;
|
|
172
177
|
}
|
|
173
178
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/richtext",
|
|
3
|
-
"version": "20.72.3-alpha.
|
|
3
|
+
"version": "20.72.3-alpha.8+bc4cf36434",
|
|
4
4
|
"description": "Common functionality and types for Uniform Rich Text parameters",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@lexical/link": "0.45.0",
|
|
45
45
|
"@lexical/list": "0.45.0",
|
|
46
46
|
"@lexical/rich-text": "0.45.0",
|
|
47
|
-
"@uniformdev/assets": "20.72.3-alpha.
|
|
47
|
+
"@uniformdev/assets": "20.72.3-alpha.8+bc4cf36434",
|
|
48
48
|
"lexical": "0.45.0"
|
|
49
49
|
},
|
|
50
50
|
"files": [
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "bc4cf3643488dcbc8929bbef6e554ca53de2dd37"
|
|
57
57
|
}
|