This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(Meteor.isServer) { | |
cheerio = Npm.require("cheerio"); | |
} | |
validEmail = function (email) { | |
var re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | |
return re.test(email); | |
}; | |
purify = function(text, allowedTags, allowedAttributes) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
purify = function(text, allowedTags, allowedAttributes) { | |
if(!allowedTags) allowedTags = ['b', 'i', 'strong', 'em', 'ol', 'ul', 'li', 'p', 'span', 'a', 'img', 'br']; | |
if(!allowedAttributes) allowedAttributes = ['href', 'src']; | |
var disallowedTags = ['b', 'i', 'strong', 'em', 'blockquote', 'ol', 'ul', 'li', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'h7', 'p', 'span', 'pre', 'a', 'u', 'img', 'br', 'table']; | |
// Check the difference between the default enabled tags and the allowed tags | |
var disallowedTags = _.difference(disallowedTags, allowedTags); |
NewerOlder