@solidjs/html 2.0.0-rc.18 → 2.0.0-rc.19

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.
Files changed (2) hide show
  1. package/dist/html.js +9 -0
  2. package/package.json +2 -2
package/dist/html.js CHANGED
@@ -400,6 +400,7 @@ function createHtml() {
400
400
  }
401
401
  node.children.forEach(child => buildTemplate(child, insideTemplate));
402
402
  } else if (node.type === COMPONENT_NODE || node.type === ROOT_NODE) {
403
+ if (node.type === COMPONENT_NODE) decodeStaticProps(node);
403
404
  node.children.forEach(child => buildTemplate(child, false));
404
405
  } else if (node.type === TEXT_NODE && !insideTemplate) {
405
406
  textTemplate.innerHTML = node.value;
@@ -407,6 +408,13 @@ function createHtml() {
407
408
  }
408
409
  };
409
410
  const textTemplate = document.createElement("template");
411
+ const decodeStaticProps = node => {
412
+ for (const prop of node.props) {
413
+ if (prop.type !== STATIC_PROP || !prop.value.includes("&")) continue;
414
+ textTemplate.innerHTML = `<i a="${prop.value.replace(/"/g, "&quot;")}"></i>`;
415
+ prop.value = textTemplate.content.firstChild.getAttribute("a");
416
+ }
417
+ };
410
418
  const buildNodes = node => {
411
419
  switch (node.type) {
412
420
  case TEXT_NODE:
@@ -420,6 +428,7 @@ function createHtml() {
420
428
  let hasSpread = false;
421
429
  const elem = createElement(node.name);
422
430
  const claimAttr = node.name === "a" ? "href" : node.name === "form" ? "action" : undefined;
431
+ decodeStaticProps(node);
423
432
  node.props = node.props.filter(prop => {
424
433
  if (prop.type === STATIC_PROP) {
425
434
  if (prop.name.startsWith("prop:")) return true;
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.18",
4
+ "version": "2.0.0-rc.19",
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.18"
45
+ "@solidjs/web": "^2.0.0-rc.19"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@solidjs/web": "workspace:*",