<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>{strip}</title> <meta name="generator" content="DocBook XSL Stylesheets V1.75.1"> <link rel="home" href="index.html" title="Smarty Manual"> <link rel="up" href="language.builtin.functions.html" title="Chapter 7. Built-in Functions"> <link rel="prev" href="language.function.section.html" title="{section},{sectionelse}"> <link rel="next" href="language.custom.functions.html" title="Chapter 8. Custom Functions"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr><th colspan="3" align="center">{strip}</th></tr> <tr> <td width="20%" align="left"> <a accesskey="p" href="language.function.section.html">Prev</a> </td> <th width="60%" align="center">Chapter 7. Built-in Functions</th> <td width="20%" align="right"> <a accesskey="n" href="language.custom.functions.html">Next</a> </td> </tr> </table> <hr> </div> <div class="sect1" title="{strip}"> <div class="titlepage"><div><div><h2 class="title" style="clear: both"> <a name="language.function.strip"></a>{strip}</h2></div></div></div> <p> Many times web designers run into the issue where white space and carriage returns affect the output of the rendered HTML (browser "features"), so you must run all your tags together in the template to get the desired results. This usually ends up in unreadable or unmanageable templates. </p> <p> Anything within <code class="varname">{strip}{/strip}</code> tags are stripped of the extra spaces or carriage returns at the beginnings and ends of the lines before they are displayed. This way you can keep your templates readable, and not worry about extra white space causing problems. </p> <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"> <h3 class="title">Note</h3> <p> <code class="varname">{strip}{/strip}</code> does not affect the contents of template variables, see the <a class="link" href="language.modifier.strip.html" title="strip">strip modifier</a> instead. </p> </div> <div class="example"> <a name="id3057278"></a><p class="title"><b>Example 7.44. {strip} tags</b></p> <div class="example-contents"> <pre class="programlisting"> {* the following will be all run into one line upon output *} {strip} <table border='0'> <tr> <td> <a href="{$url}"> <font color="red">This is a test</font> </a> </td> </tr> </table> {/strip} </pre> <p> The above example will output: </p> <pre class="screen"> <table border='0'><tr><td><a href="http://. snipped...</a></td></tr></table> </pre> </div> </div> <br class="example-break"><p> Notice that in the above example, all the lines begin and end with HTML tags. Be aware that all the lines are run together. If you have plain text at the beginning or end of any line, they will be run together, and may not be desired results. </p> <p> See also the <a class="link" href="language.modifier.strip.html" title="strip"><code class="varname">strip</code></a> modifier. </p> </div> <div class="navfooter"> <hr> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"> <a accesskey="p" href="language.function.section.html">Prev</a> </td> <td width="20%" align="center"><a accesskey="u" href="language.builtin.functions.html">Up</a></td> <td width="40%" align="right"> <a accesskey="n" href="language.custom.functions.html">Next</a> </td> </tr> <tr> <td width="40%" align="left" valign="top">{section},{sectionelse} </td> <td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td> <td width="40%" align="right" valign="top"> Chapter 8. Custom Functions</td> </tr> </table> </div> </body> </html>