- 02 Mar, 2016 13 commits
-
-
Andrew Nicols authored
-
-
Andrew Nicols authored
-
-
-
Rajesh Taneja authored
-
David Monllaó authored
-
-
Andrew Nicols authored
-
Andrew Nicols authored
This is required for when helpers include json-encoded variables as arguments. As an example, imagine a template with content: {{# str }} somekey, someidentifier, { "fullname": "{{ fullname }}" } {{/ str }} If the fullname variable were to include the double-quote character (e.g. John "Trevor" Doe) because of the way in which mustache renders content, it would become: {{# str }} somekey, someidentifier, { "fullname": "John "Trevor" Doe" } {{/ str }} This results in an invalid JSON structure. To work around this issue, the quote characters in the passed variable must be escaped: {{# str }} somekey, someidentifier, { "fullname": "John \"Trevor\" Doe" } {{/ str }} Unfortunately, Mustache provides no way of doing so natively. With this function, we can quote the text as appropriate: {{# str }} somekey, someidentifier, { "fullname": {{# quote }}{{ fullname }}{{/ quote }} } {{/ str }} This also handles the case where the quoted content includes the Mustache delimeter ({{ or }}). For example: fullname = 'John "}}Trevor{{" Doe' Ordinarily this would be rendered as: {{# str }} somekey, someidentifier, { "fullname": "John "}}Trevor{{" Doe" } {{/ str }} This rendering is both a JSON error, and also a mustache syntax error because of the mustache delimeters. The quote helper also escapes these by wrapping them in change delimeter tags: {{# str }} somekey, someidentifier, { "fullname": "John "{{=<% %>=}}}}<%={{ }}=%>Trevor{{=<% %>=}}{{{{=<% %>=}}" Doe" } {{/ str }}
-
-
-
-
- 01 Mar, 2016 27 commits
-
-
Dan Poltawski authored
-
-
-
-
-
-
David Monllaó authored
-
Damyon Wiese authored
Sync is now automatically triggered by add/update instance. We need to manually trigger sync before each part of the test to clean up role assignments from the previous test.
-
Andrew Nicols authored
-
-
Mark Nelson authored
-
-
-
-
-
-
-
David Monllaó authored
We can not rely on the db engine returning results in the same order if no order is specified in get_comments and get_annotations. Also fixing a related unit test.
-
Damyon Wiese authored
This restores backwards compatible behaviour.
-
Andrew Hancox authored
-
-
-
Marina Glancy authored
-
Andrew Nicols authored
-
Andrew Nicols authored
External tests only
-
-
-