Blocks:strip

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

strip(string $mode = 'default')


 * mode : the stripping mode defines some rules to prevent harmful behavior on some types of content, currently the only special mode is "js" or "javascript" that ensures javascript line comments do not break the script

Example: 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:

This will render the output to:

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.


 * This will remove all comments inside the script.
 * Be careful to code properly and end each instruction with a ";", otherwise it might become "foobar" and the browser will most likely treat that as an error. Use JSLint to test your code if you have issues.