@lwc/template-compiler 7.1.3 → 7.1.4

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.js CHANGED
@@ -13144,6 +13144,8 @@ function serializeAttrs(element, codeGen) {
13144
13144
  if (name === 'spellcheck' && typeof v === 'string' && !hasExpression) {
13145
13145
  v = String(v.toLowerCase() !== 'false');
13146
13146
  }
13147
+ // See W-16614169
13148
+ const escapedAttributeName = templateStringEscape(name);
13147
13149
  if (typeof v === 'string') {
13148
13150
  // IDs/IDRefs must be handled dynamically at runtime due to synthetic shadow scoping.
13149
13151
  // Skip serializing here and handle it as if it were a dynamic attribute instead.
@@ -13153,10 +13155,12 @@ function serializeAttrs(element, codeGen) {
13153
13155
  const needsPlaceholder = hasExpression || hasIdOrIdRef || hasSvgUseHref || hasScopedFragmentRef;
13154
13156
  // Inject a placeholder where the staticPartId will go when an expression occurs.
13155
13157
  // This is only needed for SSR to inject the expression value during serialization.
13156
- attrs.push(needsPlaceholder ? `\${"${v}"}` : ` ${name}="${htmlEscape(v, true)}"`);
13158
+ attrs.push(needsPlaceholder
13159
+ ? `\${"${v}"}`
13160
+ : ` ${escapedAttributeName}="${htmlEscape(v, true)}"`);
13157
13161
  }
13158
13162
  else {
13159
- attrs.push(` ${name}`);
13163
+ attrs.push(` ${escapedAttributeName}`);
13160
13164
  }
13161
13165
  };
13162
13166
  element.attributes
@@ -13251,7 +13255,9 @@ function serializeStaticElement(element, codeGen) {
13251
13255
  const { name: tagName, namespace } = element;
13252
13256
  const isForeignElement = namespace !== HTML_NAMESPACE;
13253
13257
  const hasChildren = element.children.length > 0;
13254
- let html = `<${tagName}${serializeAttrs(element, codeGen)}`;
13258
+ // See W-16469970
13259
+ const escapedTagName = templateStringEscape(tagName);
13260
+ let html = `<${escapedTagName}${serializeAttrs(element, codeGen)}`;
13255
13261
  if (isForeignElement && !hasChildren) {
13256
13262
  html += '/>';
13257
13263
  return html;
@@ -13260,7 +13266,7 @@ function serializeStaticElement(element, codeGen) {
13260
13266
  const children = transformStaticChildren(element, codeGen.preserveComments);
13261
13267
  html += serializeChildren(children, tagName, codeGen);
13262
13268
  if (!isVoidElement(tagName, namespace) || hasChildren) {
13263
- html += `</${tagName}>`;
13269
+ html += `</${escapedTagName}>`;
13264
13270
  }
13265
13271
  return html;
13266
13272
  }
@@ -14678,5 +14684,5 @@ function compile(source, filename, config) {
14678
14684
  }
14679
14685
 
14680
14686
  export { ElementDirectiveName, LWCDirectiveDomMode, LWCDirectiveRenderMode, LwcTagName, RootDirectiveName, TemplateDirectiveName, compile, compile as default, kebabcaseToCamelcase, parse, toPropertyName };
14681
- /** version: 7.1.3 */
14687
+ /** version: 7.1.4 */
14682
14688
  //# sourceMappingURL=index.js.map