Skip to content

Commit

Permalink
Add raw filter to not escape JS
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Sep 1, 2020
1 parent c3621c1 commit 682ff53
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/templates/SetonoTagBagGtag/config.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
{% if parameters|length > 0 %}
gtag('config', '{{ target }}', {{ parameters|json_encode(constant('JSON_THROW_ON_ERROR') b-or constant('JSON_PRETTY_PRINT') b-or constant('JSON_UNESCAPED_SLASHES') b-or constant('JSON_PRESERVE_ZERO_FRACTION') b-or constant('JSON_INVALID_UTF8_IGNORE')) }});
gtag('config', '{{ target }}', {{ parameters|json_encode(constant('JSON_THROW_ON_ERROR') b-or constant('JSON_PRETTY_PRINT') b-or constant('JSON_UNESCAPED_SLASHES') b-or constant('JSON_PRESERVE_ZERO_FRACTION') b-or constant('JSON_INVALID_UTF8_IGNORE'))|raw }});
{% else %}
gtag('config', '{{ target }}');
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion src/templates/SetonoTagBagGtag/event.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
{% if parameters|length > 0 %}
gtag('event', '{{ event }}', {{ parameters|json_encode(constant('JSON_THROW_ON_ERROR') b-or constant('JSON_PRETTY_PRINT') b-or constant('JSON_UNESCAPED_SLASHES') b-or constant('JSON_PRESERVE_ZERO_FRACTION') b-or constant('JSON_INVALID_UTF8_IGNORE')) }});
gtag('event', '{{ event }}', {{ parameters|json_encode(constant('JSON_THROW_ON_ERROR') b-or constant('JSON_PRETTY_PRINT') b-or constant('JSON_UNESCAPED_SLASHES') b-or constant('JSON_PRESERVE_ZERO_FRACTION') b-or constant('JSON_INVALID_UTF8_IGNORE'))|raw }});
{% else %}
gtag('event', '{{ event }}');
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion src/templates/SetonoTagBagGtag/set.html.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<script>
gtag('set', {{ parameters|json_encode(constant('JSON_THROW_ON_ERROR') b-or constant('JSON_PRETTY_PRINT') b-or constant('JSON_UNESCAPED_SLASHES') b-or constant('JSON_PRESERVE_ZERO_FRACTION') b-or constant('JSON_INVALID_UTF8_IGNORE')) }});
gtag('set', {{ parameters|json_encode(constant('JSON_THROW_ON_ERROR') b-or constant('JSON_PRETTY_PRINT') b-or constant('JSON_UNESCAPED_SLASHES') b-or constant('JSON_PRESERVE_ZERO_FRACTION') b-or constant('JSON_INVALID_UTF8_IGNORE'))|raw }});
</script>

0 comments on commit 682ff53

Please sign in to comment.