Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
striptags() #handlebars #helper #cc
Handlebars.registerHelper("striptags", function( txt ){
// exit now if text is undefined
if(typeof txt == "undefined") return;
// the regular expresion
var regexp = new RegExp('#([^\\s]*)','g');
// replacing the text
return txt.replace(regexp, '');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.