shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
stripTags
Type:Function
Status:stable
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.html
Strip tags of an html string. This is a simple wrapper of the nice “striptags” package that you can find here: https://www.npmjs.com/package/striptags
Params
- html*-String
The html string to process
- allowedTags*-String[]
The tags that are allowed like [‘a’,‘p’,‘h1’,‘h2’]…
- tagReplacement*-String
A string with which you want to replace the tags
Return
- -String
The processed string without tags
Example
import { stripTags } from '@blackbyte/sugar/html'
stripTags('<p><span>Hello</span> world</p>', '<span>') // <span>Hello</span> worldTodo
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space