Saturday, 29 April 2017

Stripping HTML Down To Allowed Tags

I'd like to strip all HTML tags (but not the content), apart from ones given in a list.

I'd like to do this using Node.

The following regex can match tags <[a|br].+?>|<\/[a]> but how can I then proceed to remove all tags except the ones matched?



via Lolums

No comments:

Post a Comment