Skip to content

Commit

Permalink
Comments cleanup in template parser proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
hugithordarson committed Nov 15, 2024
1 parent 33510ab commit e055f30
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,15 @@ private static NGAssociation associationForInlineBindingString( String value ) t
*/
private static NGElement template( NGDynamicHTMLTag tag ) throws NGDeclarationFormatException {

// FIXME: Children should never really be null. I'm still hesitant to replace it with an empty list though, since in my mind that represents an empty container tag. Food for thought... // Hugi 2024-11-15
if( tag.children() == null ) {
return null;
}

final List<PNode> childNodes = combineAndWrapBareStrings( tag.children() );
final List<NGElement> childElements = new ArrayList<>();

for( PNode pNode : childNodes ) {
for( final PNode pNode : childNodes ) {
childElements.add( toDynamicElement( pNode ) );
}

Expand All @@ -153,8 +154,8 @@ private static NGElement template( NGDynamicHTMLTag tag ) throws NGDeclarationFo
}

/**
* Iterates through the list, combining adjacent strings and wrapping them in NGHTMLBareStrings
* Other elements get added directly to the element list.
* Iterates through the list, combining adjacent strings before wrapping them in a PHTMLNode
* Other nodes just get added to the list.
*/
private static List<PNode> combineAndWrapBareStrings( List<Object> children ) {
final List<PNode> childElements = new ArrayList<>( children.size() );
Expand Down

0 comments on commit e055f30

Please sign in to comment.