socketsupply / tonic

A Low Profile Component Framework – Stable, minimal, easy to audit, zero-dependencies and build-tool-free.
http://tonicframework.dev
MIT License
867 stars 24 forks source link

Allow passing an array of templates #59

Closed Raynos closed 4 years ago

Raynos commented 4 years ago

The common use case for Tonic.unsafeRawString is to do some kind of repeated template or looping.

This adds the ability to pass an array of this.html results in another this.html expression.

This covers 16 / 18 or 89% of the use cases of Tonic.unsafeRawString.

The remaining 2 use cases have subtle usage of Tonic.escape to do manual escaping for security that require actual review.

r: @heapwolf

Raynos commented 4 years ago

Approved in slack.