-
Notifications
You must be signed in to change notification settings - Fork 339
-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backslash in template should be escaped before rendering #145
Comments
Since that is JavaScript code, and you are passing a javascript string, the following string "\\".length
1
"\".length
Unterminated string constant So JsRender implementation code will see Putting |
… many new features. More samples and documentation for new features will be added incrementally in coming updates. Among the changes: Detailed APIs modified for consistent arguments and use of this pointer, and for maximum extensibility. See updated samples for usage... Compiled templates restructured for easier debugging. View object restructured for clarity. View now has a type property, e.g. type="item" Only "item" views have index properties, but to get the index from a nested view use view.get("item").index. nodes collection on a view is now a function, view.nodes(). Settings grouped onto a $.views.settings object. View navigation features improved, with view.get(...) and $.view(elem, ...) tagCtx object provides improved access to the args and properties of a tag invocation. Adding resources (helpers, converters, tags, etc) to a template now supported by passing parent template to API. e.g. $.tags({...}, parentTemplate). Many improvements to custom tags, - used also as part of JsViews integration for new JsViews Tag Controls. (Instantiation of tags as control instances). Template inclusion now supported with simpler syntax {{for tmpl=.../)) Fixes for issues #169, #162, #157, #156, #155, #153, #145
This has been fixed in commit 22. Please reopen if the fix does not work for you. Thanks! |
Rendering templates with backslash will turns two backslashes into one.
You can test the following code at a console on page http://borismoore.github.com/jsrender/demos/step-by-step/20_without-jquery.html.
Expected: two backslashes, i.e. '\'
Actual: one backslahes, i.e. ''
p.s. template of '\t' should render '\t', instead of ' '.
The text was updated successfully, but these errors were encountered: