Skip to content

Commit

Permalink
tonic: Support an array of templates
Browse files Browse the repository at this point in the history
This allows the user to place an array of templates inline
when he wants to loop over something.
  • Loading branch information
Raynos committed Sep 2, 2020
1 parent c9c83ef commit 86e7a7b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ class Tonic extends window.HTMLElement {
case '[object HTMLCollection]':
case '[object NodeList]': return this._placehold([...o])
case '[object Array]':
if (o.every(x => x.isTonicUnsafeString)) {
return Tonic.unsafeRawString(o.join('\n'))
}
return this._prop(o)
case '[object Object]':
case '[object Function]': return this._prop(o)
case '[object NamedNodeMap]':
Expand Down

0 comments on commit 86e7a7b

Please sign in to comment.