-
-
Notifications
You must be signed in to change notification settings - Fork 20
Description
This is useful if you want to embed an ECR template, read a file, etc into the Builder without creating an intermediate string.
I've got WIP code here but I'm not sure if the API could be improved.
How I think this should work is there are two methods, one gives access to the IO directly for writing HTML, and another gives access to a wrapped IO that pipes the input through HTML.escape first. This is a pattern I've used before.
The most natural API to me would be to allow passing a block to text and html instead of a string argument, but html(&block) is already defined to create an <html> tag.
What I've got currently is text(escaping : Bool = true, &block) which is fine. If someone else has another idea of how this could be done without conflicting with the html tag method, I'll happily change my implementation.