@solidjs/html 2.0.0-rc.21 → 2.0.0-rc.23
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/html.js +4 -4
- package/package.json +2 -2
package/dist/html.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RawTextElements, spread, claimElement, createComponent, insert, mergeProps, SVGElements, MathMLElements, VoidElements } from '@solidjs/web';
|
|
1
|
+
import { RawTextElements, trustedHTML, spread, claimElement, createComponent, insert, mergeProps, SVGElements, MathMLElements, VoidElements } from '@solidjs/web';
|
|
2
2
|
|
|
3
3
|
const OPEN_TAG_TOKEN = 0;
|
|
4
4
|
const CLOSE_TAG_TOKEN = 1;
|
|
@@ -403,7 +403,7 @@ function createHtml() {
|
|
|
403
403
|
if (node.type === COMPONENT_NODE) decodeStaticProps(node);
|
|
404
404
|
node.children.forEach(child => buildTemplate(child, false));
|
|
405
405
|
} else if (node.type === TEXT_NODE && !insideTemplate) {
|
|
406
|
-
textTemplate.innerHTML = node.value;
|
|
406
|
+
textTemplate.innerHTML = trustedHTML(node.value);
|
|
407
407
|
node.value = textTemplate.content.textContent ?? "";
|
|
408
408
|
}
|
|
409
409
|
};
|
|
@@ -411,14 +411,14 @@ function createHtml() {
|
|
|
411
411
|
const decodeStaticProps = node => {
|
|
412
412
|
for (const prop of node.props) {
|
|
413
413
|
if (prop.type !== STATIC_PROP || !prop.value.includes("&")) continue;
|
|
414
|
-
textTemplate.innerHTML = `<i a="${prop.value.replace(/"/g, """)}"></i
|
|
414
|
+
textTemplate.innerHTML = trustedHTML(`<i a="${prop.value.replace(/"/g, """)}"></i>`);
|
|
415
415
|
prop.value = textTemplate.content.firstChild.getAttribute("a");
|
|
416
416
|
}
|
|
417
417
|
};
|
|
418
418
|
const buildNodes = node => {
|
|
419
419
|
switch (node.type) {
|
|
420
420
|
case TEXT_NODE:
|
|
421
|
-
textTemplate.innerHTML = node.value;
|
|
421
|
+
textTemplate.innerHTML = trustedHTML(node.value);
|
|
422
422
|
return document.createTextNode(textTemplate.content.textContent ?? "");
|
|
423
423
|
case EXPRESSION_NODE:
|
|
424
424
|
return document.createComment("+");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidjs/html",
|
|
3
3
|
"description": "Tagged-template-literal templating for Solid — write components with no build step.",
|
|
4
|
-
"version": "2.0.0-rc.
|
|
4
|
+
"version": "2.0.0-rc.23",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://solidjs.com",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"test": "vitest run"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@solidjs/web": "^2.0.0-rc.
|
|
45
|
+
"@solidjs/web": "^2.0.0-rc.23"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@solidjs/web": "workspace:*",
|