[stringtemplate-interest] HTML escaping
Terence Parr
parrt at cs.usfca.edu
Tue Mar 25 16:58:21 PDT 2008
On Mar 21, 2008, at 1:50 AM, Christopher Brown wrote:
> I'd just like to take this opportunity to thank those involved in
> releasing the ST#3.1 beta, which now has the "format" option and which
> is useful for exactly this sort of thing (avoiding script injection).
Kunle and Michael be praised!
> Incidentally, on the subject of registering formatters (on the C#
> version), I can't register a formatter by interface, which is a shame.
> I have three classes that implement "ITranslated", so I had to write
> this :
>
> // can't register attribute renderer for interfaces :-(
> TranslationRenderer translationRenderer = new
> TranslationRenderer(_engine, _localeProvider);
> template.RegisterAttributeRenderer(typeof(LmsPath),
> translationRenderer);
> template.RegisterAttributeRenderer(typeof(LmsModule),
> translationRenderer);
> template.RegisterAttributeRenderer(typeof(Discipline),
> translationRenderer);
>
> ...instead of doing it just once, for "typeof(ITranslated)". I'm
> guessing the reflection code is comparing the type and not taking into
> account implemented interfaces. Is there any chance this might be
> improved in future versions?
Those guys are incredibly busy and don't have much time. I would not
hold my breath.
Ter
More information about the stringtemplate-interest
mailing list