Back

Strip HTML tags from WYSIWYG Field Output

Description

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.

Code

$!{URLMapContent.field.replaceAll('<(.|\n)+?>','')}