@zubra/runtime 5.2.0 → 5.3.0

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.
@@ -56,7 +56,12 @@ export function remark(root, template, parts, { blueprint, isOpen, isClose, read
56
56
  let index = 0;
57
57
  for (; t; t = t.nextSibling) {
58
58
  if (t.nodeType === TEXT) {
59
- if (cursor?.nodeType === TEXT) cursor = cursor.nextSibling; // static text (if kept)
59
+ // Static text (if kept): the same words as the template's. Text that isn't (a page's own
60
+ // `<x-a>Save</x-a>` where the template has only whitespace) isn't server markup.
61
+ if (cursor?.nodeType === TEXT) {
62
+ if (cursor.data.trim() !== t.data.trim()) throw fail;
63
+ cursor = cursor.nextSibling;
64
+ }
60
65
  continue;
61
66
  }
62
67
  const path = [...prefix, index];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zubra/runtime",
3
- "version": "5.2.0",
3
+ "version": "5.3.0",
4
4
  "description": "Browser runtime for Zubra compiled components, built on the TC39 Signals API",
5
5
  "license": "ISC",
6
6
  "repository": {
package/src/remark.js CHANGED
@@ -55,7 +55,12 @@ export function remark(root, template, parts, { blueprint, isOpen, isClose, read
55
55
  let index = 0;
56
56
  for (; t; t = t.nextSibling) {
57
57
  if (t.nodeType === TEXT) {
58
- if (cursor?.nodeType === TEXT) cursor = cursor.nextSibling; // static text (if kept)
58
+ // Static text (if kept): the same words as the template's. Text that isn't (a page's own
59
+ // `<x-a>Save</x-a>` where the template has only whitespace) isn't server markup.
60
+ if (cursor?.nodeType === TEXT) {
61
+ if (cursor.data.trim() !== t.data.trim()) throw fail;
62
+ cursor = cursor.nextSibling;
63
+ }
59
64
  continue;
60
65
  }
61
66
  const path = [...prefix, index];