Skip to content

Commit

Permalink
Added :discount filter
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Mar 4, 2011
1 parent ef76b66 commit c68809f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/filters.js
Expand Up @@ -53,9 +53,17 @@ module.exports = {
markdown: function(str){
var md = require('markdown');
str = str.replace(/\\n/g, '\n');
return (md.toHTML
? md.toHTML(str)
: md.parse(str)).replace(/\n/g, '\\n').replace(/'/g,''');
return md.parse(str).replace(/\n/g, '\\n').replace(/'/g,''');
},

/**
* Transform markdown to html.
*/

discount: function(str){
var md = require('discount');
str = str.replace(/\\n/g, '\n');
return md.parse(str).replace(/\n/g, '\\n').replace(/'/g,''');
},

/**
Expand Down

0 comments on commit c68809f

Please sign in to comment.