@lwc/template-compiler 7.1.3 → 7.1.5

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.cjs.js CHANGED
@@ -13168,6 +13168,8 @@ function serializeAttrs(element, codeGen) {
13168
13168
  if (name === 'spellcheck' && typeof v === 'string' && !hasExpression) {
13169
13169
  v = String(v.toLowerCase() !== 'false');
13170
13170
  }
13171
+ // See W-16614169
13172
+ const escapedAttributeName = templateStringEscape(name);
13171
13173
  if (typeof v === 'string') {
13172
13174
  // IDs/IDRefs must be handled dynamically at runtime due to synthetic shadow scoping.
13173
13175
  // Skip serializing here and handle it as if it were a dynamic attribute instead.
@@ -13177,10 +13179,12 @@ function serializeAttrs(element, codeGen) {
13177
13179
  const needsPlaceholder = hasExpression || hasIdOrIdRef || hasSvgUseHref || hasScopedFragmentRef;
13178
13180
  // Inject a placeholder where the staticPartId will go when an expression occurs.
13179
13181
  // This is only needed for SSR to inject the expression value during serialization.
13180
- attrs.push(needsPlaceholder ? `\${"${v}"}` : ` ${name}="${shared.htmlEscape(v, true)}"`);
13182
+ attrs.push(needsPlaceholder
13183
+ ? `\${"${v}"}`
13184
+ : ` ${escapedAttributeName}="${shared.htmlEscape(v, true)}"`);
13181
13185
  }
13182
13186
  else {
13183
- attrs.push(` ${name}`);
13187
+ attrs.push(` ${escapedAttributeName}`);
13184
13188
  }
13185
13189
  };
13186
13190
  element.attributes
@@ -13275,7 +13279,9 @@ function serializeStaticElement(element, codeGen) {
13275
13279
  const { name: tagName, namespace } = element;
13276
13280
  const isForeignElement = namespace !== shared.HTML_NAMESPACE;
13277
13281
  const hasChildren = element.children.length > 0;
13278
- let html = `<${tagName}${serializeAttrs(element, codeGen)}`;
13282
+ // See W-16469970
13283
+ const escapedTagName = templateStringEscape(tagName);
13284
+ let html = `<${escapedTagName}${serializeAttrs(element, codeGen)}`;
13279
13285
  if (isForeignElement && !hasChildren) {
13280
13286
  html += '/>';
13281
13287
  return html;
@@ -13284,7 +13290,7 @@ function serializeStaticElement(element, codeGen) {
13284
13290
  const children = transformStaticChildren(element, codeGen.preserveComments);
13285
13291
  html += serializeChildren(children, tagName, codeGen);
13286
13292
  if (!shared.isVoidElement(tagName, namespace) || hasChildren) {
13287
- html += `</${tagName}>`;
13293
+ html += `</${escapedTagName}>`;
13288
13294
  }
13289
13295
  return html;
13290
13296
  }
@@ -14706,5 +14712,5 @@ exports.default = compile;
14706
14712
  exports.kebabcaseToCamelcase = kebabcaseToCamelcase;
14707
14713
  exports.parse = parse;
14708
14714
  exports.toPropertyName = toPropertyName;
14709
- /** version: 7.1.3 */
14715
+ /** version: 7.1.5 */
14710
14716
  //# sourceMappingURL=index.cjs.js.map