Skip to content

Commit

Permalink
Allow element template with a velog() at the root that calls another …
Browse files Browse the repository at this point in the history
…element template

PiperOrigin-RevId: 703204522
  • Loading branch information
jobi authored and copybara-github committed Dec 6, 2024
1 parent 304b0b4 commit 6cf5ebc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions java/src/com/google/template/soy/passes/SoyElementPass.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,6 @@ private HtmlElementMetadataP getTemplateMetadata(
break; // skip reporting additional errors
}
openTag = maybeOpenTagNode;
} else if (isElmOrHtml) {
this.errorReporter.report(template.getSourceLocation(), ELEMENT_TEMPLATE_EXACTLY_ONE_TAG);
reportedSingleHtmlElmError = true;
} else {
List<CallBasicNode> callNodes =
veLogNode.getChildren().stream()
Expand All @@ -240,6 +237,10 @@ private HtmlElementMetadataP getTemplateMetadata(
} else if (isSoyElement) {
this.errorReporter.report(veLogNode.getSourceLocation(), SOY_ELEMENT_EXACTLY_ONE_TAG);
reportedSingleHtmlElmError = true;
} else if (isElmOrHtml) {
this.errorReporter.report(
template.getSourceLocation(), ELEMENT_TEMPLATE_EXACTLY_ONE_TAG);
reportedSingleHtmlElmError = true;
}
}
} else {
Expand Down

0 comments on commit 6cf5ebc

Please sign in to comment.