Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
/**
* Removes all HTML tags from a string.
*
* [section: View Helpers]
* [category: Sanitization Functions]
*
* @html The HTML to remove tag markup from.
*/
public string function stripTags(required string html) {
local.rv = REReplaceNoCase(arguments.html, "<\ *[a-z].*?>", "", "all");
local.rv = REReplaceNoCase(local.rv, "<\ */\ *[a-z].*?>", "", "all");
return local.rv;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment