aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/smarty/smarty/docs/designers/language-basic-syntax/language-escaping.md
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-07-11 18:57:18 +0000
committerMario <mario@mariovavti.com>2023-07-11 18:57:18 +0000
commit63fb8d03929189bfc8cbf53d23cb79984fe2c3cd (patch)
treeb9f74bd8c7721dca7ece251fdbb9a7c4fe9b949a /vendor/smarty/smarty/docs/designers/language-basic-syntax/language-escaping.md
parent57796a2f962d045445cbf69237bb3d6786e4d0d4 (diff)
parent384de0925e502cfa8fe6ca287530ef5529fdff10 (diff)
downloadvolse-hubzilla-63fb8d03929189bfc8cbf53d23cb79984fe2c3cd.tar.gz
volse-hubzilla-63fb8d03929189bfc8cbf53d23cb79984fe2c3cd.tar.bz2
volse-hubzilla-63fb8d03929189bfc8cbf53d23cb79984fe2c3cd.zip
Merge branch '8.6RC'8.6
Diffstat (limited to 'vendor/smarty/smarty/docs/designers/language-basic-syntax/language-escaping.md')
-rw-r--r--vendor/smarty/smarty/docs/designers/language-basic-syntax/language-escaping.md93
1 files changed, 44 insertions, 49 deletions
diff --git a/vendor/smarty/smarty/docs/designers/language-basic-syntax/language-escaping.md b/vendor/smarty/smarty/docs/designers/language-basic-syntax/language-escaping.md
index a62e7de89..4c75e09e6 100644
--- a/vendor/smarty/smarty/docs/designers/language-basic-syntax/language-escaping.md
+++ b/vendor/smarty/smarty/docs/designers/language-basic-syntax/language-escaping.md
@@ -1,11 +1,10 @@
-Escaping Smarty Parsing {#language.escaping}
-=======================
+# Escaping Smarty parsing
It is sometimes desirable or even necessary to have Smarty ignore
sections it would otherwise parse. A classic example is embedding
Javascript or CSS code in a template. The problem arises as those
languages use the { and } characters which are also the default
-[delimiters](#language.function.ldelim) for Smarty.
+[delimiters](../language-builtin-functions/language-function-ldelim.md) for Smarty.
> **Note**
>
@@ -17,37 +16,37 @@ languages use the { and } characters which are also the default
In Smarty templates, the { and } braces will be ignored so long as they
are surrounded by white space. This behavior can be disabled by setting
-the Smarty class variable [`$auto_literal`](#variable.auto.literal) to
+the Smarty class variable [`$auto_literal`](../../programmers/api-variables/variable-auto-literal.md) to
false.
-
- <script>
- // the following braces are ignored by Smarty
- // since they are surrounded by whitespace
- function foobar {
- alert('foobar!');
- }
- // this one will need literal escapement
- {literal}
- function bazzy {alert('foobar!');}
- {/literal}
- </script>
-
+## Examples
+
+```smarty
+<script>
+ // the following braces are ignored by Smarty
+ // since they are surrounded by whitespace
+ function foobar {
+ alert('foobar!');
+ }
+ // this one will need literal escapement
+ {literal}
+ function bazzy {alert('foobar!');}
+ {/literal}
+</script>
+```
-
-[`{literal}..{/literal}`](#language.function.literal) blocks are used
+[`{literal}..{/literal}`](../language-builtin-functions/language-function-literal.md) blocks are used
for escaping blocks of template logic. You can also escape the braces
individually with
-[`{ldelim}`](#language.function.ldelim),[`{rdelim}`](#language.function.ldelim)
-tags or
-[`{$smarty.ldelim}`,`{$smarty.rdelim}`](#language.variables.smarty.ldelim)
+[`{ldelim}`, `{rdelim}`](../language-builtin-functions/language-function-ldelim.md) tags or
+[`{$smarty.ldelim}`,`{$smarty.rdelim}`](../language-variables/language-variables-smarty.md#smartyldelim-smartyrdelim-languagevariablessmartyldelim)
variables.
-Smarty\'s default delimiters { and } cleanly represent presentational
-content. However if another set of delimiters suit your needs better,
-you can change them with Smarty\'s
-[`$left_delimiter`](#variable.left.delimiter) and
-[`$right_delimiter`](#variable.right.delimiter) values.
+Smarty's default delimiters { and } cleanly represent presentational
+content. However, if another set of delimiters suit your needs better,
+you can change them with Smarty's
+[`$left_delimiter`](../../programmers/api-variables/variable-left-delimiter.md) and
+[`$right_delimiter`](../../programmers/api-variables/variable-right-delimiter.md) values.
> **Note**
>
@@ -55,30 +54,26 @@ you can change them with Smarty\'s
> sure to clear out cache and compiled files if you decide to change
> them.
+```php
+<?php
- <?php
-
- $smarty->left_delimiter = '<!--{';
- $smarty->right_delimiter = '}-->';
-
- $smarty->assign('foo', 'bar');
- $smarty->assign('name', 'Albert');
- $smarty->display('example.tpl');
+$smarty->left_delimiter = '<!--{';
+$smarty->right_delimiter = '}-->';
- ?>
-
-
+$smarty->assign('foo', 'bar');
+$smarty->assign('name', 'Albert');
+$smarty->display('example.tpl');
+```
Where the template is:
-
- Welcome <!--{$name}--> to Smarty
- <script language="javascript">
- var foo = <!--{$foo}-->;
- function dosomething() {
- alert("foo is " + foo);
- }
- dosomething();
- </script>
-
-
+```smarty
+Welcome <!--{$name}--> to Smarty
+<script language="javascript">
+ var foo = <!--{$foo}-->;
+ function dosomething() {
+ alert("foo is " + foo);
+ }
+ dosomething();
+</script>
+```