Skip to content
This repository has been archived by the owner on Apr 11, 2018. It is now read-only.

Commit

Permalink
alphabetize filters
Browse files Browse the repository at this point in the history
  • Loading branch information
paularmstrong committed Aug 24, 2013
1 parent 044cf6b commit d96dd12
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions lib/filters.js
Expand Up @@ -300,21 +300,6 @@ exports.lower = function (input) {
return input.toString().toLowerCase();
};

/**
* Forces the input to not be auto-escaped. Use this only on content that you know is safe to be rendered on your page.
*
* @example
* // my_var = "<p>Stuff</p>";
* {{ my_var|safe }}
* // => <p>Stuff</p>
*
* @param {*} input
* @return {*} The input exactly how it was given, regardless of autoescaping status.
*/
exports.safe = function (input) {
// This is a magic filter. Its logic is hard-coded into Swig's parser.
return input;
};
/**
* Deprecated in favor of <a href="#safe">safe</a>.
*/
Expand Down Expand Up @@ -366,6 +351,22 @@ exports.reverse = function (input) {
return exports.sort(input, true);
};

/**
* Forces the input to not be auto-escaped. Use this only on content that you know is safe to be rendered on your page.
*
* @example
* // my_var = "<p>Stuff</p>";
* {{ my_var|safe }}
* // => <p>Stuff</p>
*
* @param {*} input
* @return {*} The input exactly how it was given, regardless of autoescaping status.
*/
exports.safe = function (input) {
// This is a magic filter. Its logic is hard-coded into Swig's parser.
return input;
};

/**
* Sort the input in an ascending direction.
* If given an object, will return the keys as a sorted array.
Expand Down

0 comments on commit d96dd12

Please sign in to comment.