strip

1.0 1.1 1.2 1.3

Removes the white-space at the beginning and end of each line, and also removes all line breaks

<?php
strip(string $mode = 'default')

Examples

Example #1

index.tpl
{strip}
   spaces between words in a same line     
  - are not removed -    
     but    
   everything   
       else   
     is     
{/strip}

The above example will output:

spaces between words in a same line- are not removed -buteverythingelseis

If you have a template with inline-Javascript, the {strip} plugin might break your script if it contains line comments.
Take a look at this example:

index.tpl
{strip}
<script type="text/javascript">
    // say hello!
    alert("hello!");
</script>
{/strip}

This will render the output to:

<script type="text/javascript"> // say hello! alert("hello!"); </script>

The script is on a single line now, and since the first line is a comment, everything is treated as a comment. To avoid this, use the js parameter inside the {strip} plugin.

index.tpl
{strip js}
<script type="text/javascript">
    // say hello!
    alert("hello!");
</script>
{/strip}