MDL-53509 mod_forum: Stop over-escaping quoted variables

{{# quote }}<a href=\"foo\">{{/ quote }}

becomes:

    "<a href=\\"foo\\">"

This causes a mustache syntax error.

The quote helper negates the need to escape quotes in normal use, e.g.:

    {{# quote }}<a href="foo">{{/ quote }}

which instead becomes:

    "<a href=\"foo\">"
This commit is contained in:
Andrew Nicols
2016-03-17 08:40:24 +08:00
parent 97dd32edd6
commit 83ca070484
2 changed files with 2 additions and 2 deletions
@@ -44,7 +44,7 @@
<div>
<a target="_blank" href="{{{ permalink }}}">{{{ subject }}}</a>
{{# str }} bynameondate, forum, {
"name": {{# quote }}<a target=\"_blank\" href=\"{{{ authorlink }}}\">{{ authorfullname }}</a>{{/ quote }},
"name": {{# quote }}<a target="_blank" href="{{{ authorlink }}}">{{ authorfullname }}</a>{{/ quote }},
"date": {{# quote }}{{ postdate }}{{/ quote }}
} {{/ str }}
</div>
@@ -88,7 +88,7 @@
</div>
<div class="author">
{{# str }} bynameondate, forum, {
"name": {{# quote }}<a target=\"_blank\" href=\"{{{ authorlink }}}\">{{ authorfullname }}</a>{{/ quote }},
"name": {{# quote }}<a target="_blank" href="{{{ authorlink }}}">{{ authorfullname }}</a>{{/ quote }},
"date": {{# quote }}{{ postdate }}{{/ quote }}
} {{/ str }}
</div>