antlr / stringtemplate4

StringTemplate 4
http://www.stringtemplate.org
Other
955 stars 231 forks source link

Issue #44 #168

Closed yateam closed 6 years ago

yateam commented 8 years ago

String Attribute Renderer called for all text - not just attributes #44

Distinguish cases when the interpreter handles static template text and dynamic attributes.

NOTE: could you consider this as a fix for this issue: https://github.com/antlr/stringtemplate4/issues/44

sharwell commented 8 years ago

💭 The edge cases (so many edge cases) are what made me finally stop looking for a direct fix for #44 and instead inject a Map<String, String> which provided the desired behavior in specific controllable cases. This pull request doesn't include any tests or a specification for the behavior of StringTemplate with a renderer registered for String.

I mentioned a couple of the edge cases in the original issue. Here are a few more:

yateam commented 8 years ago

That is sad. The template engine intended to help a lot while rendering HTML does not address html-escape at all.