BorisMoore / jsviews

Interactive data-driven views, MVVM and MVP, built on top of JsRender templates
http://www.jsviews.com/#jsviews
MIT License
855 stars 130 forks source link

Delimiters not working for "[ " and " ]" #443

Closed Autoflow closed 4 years ago

Autoflow commented 4 years ago

Hi, after a long search for practical delimiters i found "[ " and " ]" for myself being easy to read. Now there's a problem with conditional sections.

This jsfiddle says: JsRender Error: Syntax error Unmatched or missing {{/else}}, in template: [ if checked ] true [ else ] false [ /if ]

Without whitespaces everything works fine so my question is if this issue can be fixed ?

BorisMoore commented 4 years ago

Yes, that will not work. The delimiters must consist of two non-alphanumeric (and non-space) characters. I I'll update the docs here to be more specific concerning white space characters.

You can do "[" and "]" for example....

Adding a new feature to allow white space characters does not look possible. The regular expressions in the code would no longer work...

BorisMoore commented 4 years ago

I'll close this since the behavior is 'by design' - and we won't be able to allow using white-space within delimiters....