Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.3
-
None
Description
In a markup template, if you write something like:
p "This is a ${strong('bold text')}"
the user will assume that the output is:
<p>This is a <strong>bold text</strong>/</p>
However, the markup builder is a streaming builder, so calling a method in a GString results in a direct rendering to the output. At best, it will trigger a NPE, or a stack overflow.
I suggest to add the following notation to allow that kind of code:
p "This is a ${$strong('bold text')}"
The inner tag is preceded with a dollar($) sign, which tells the markup engine that the call should be rendered as a string. It would be a shortcut notation for:
p "This is a ${stringOf { strong('bold text') } }"