Unplanned
Last Updated: 01 Jul 2021 11:13 by ADMIN
Oleksandr
Created on: 23 Jan 2017 13:07
Category: Templates
Type: Feature Request
22
Make template expression delimiter '#' not conflict with HTML encoding {
Kendo templates are broken if they contain any character, which is encoded to '{' since '#' is en expression delimiter for kendo templates. Documentation suggests to escape '#' with '\\#', but this makes the very basic syntax (example using ASP.NET MVC) look ridiculous: instead of writing @Localization.Get("aaa") I need to use @Html.Raw(Html.Kendo().TemplateEncode(Html.Encode(Localization.Get("aaa")))) for every localization string I have in kendo templates (since any string may contain unicode characters in some language).
If you had '##' or '$' as expression delimiter, simple @Localization.Get("aaa") would work in 99.9% of cases.
I suggest you:
1) Fix current template syntax parser to not treat HTML-encoded symbols as template delimiters.
2) For more reliability, create second template type 'text/x-kendo-template2' with delimiter being '##', '$' or whatever is found the least conflicting after proper analysis. Make it recommended for future and make 'text/x-kendo-template' obsolete.
3) Add TemplateEncode() method to Kendo MVC extensions.
0 comments