Permalink
Browse files

Added :discount filter

  • Loading branch information...
1 parent ef76b66 commit c68809fde894fab3ef8a1bfa615d0da7656f2aaf @tj tj committed Mar 4, 2011
Showing with 11 additions and 3 deletions.
  1. +11 −3 lib/filters.js
View
@@ -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,''');
},
/**

0 comments on commit c68809f

Please sign in to comment.