Created
December 4, 2012 16:00
-
-
Save xzilla/4205488 to your computer and use it in GitHub Desktop.
ejs template to remove html tags
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
create custom filter like so: | |
ejs.filters.plaintext = function(obj) { | |
return obj.replace(/(<([^>]+)>)/ig,''); | |
}; | |
then call it like so: | |
<%=: item.content.substring(0,94) | plaintext %> |
Worked well when i applied it directly to the html string, thanks.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It didnt work for me