Strip HTML tags from WYSIWYG Field Output


Very simple method for cases where you need to get rid of the HTML tags in a contentlet field, like auto-generating a content summary when a manual summary hasn't been entered. This uses a fairly greedy regular expression match that can also be tweaked to remove specific tags.



Have you created code you'd like to share with the dotCMS community?

Share your code Become a Contributor