Skip to content

Tagless is a library that remove html tags from string, it's useful for sanitizing user input

License

Notifications You must be signed in to change notification settings

remahmoud/tagless

Repository files navigation

tagless

remove html tags from a string

Install

npm install tagless

Usage

const tagless = require('tagless')

// or

const { removeAll, removeByTag } = require('tagless')
import tagless from 'tagless'

// or

import { removeAll, removeByTag } from 'tagless'

removeAll

parse all tags from a string

parms: (string)

tagless.removeAll('<p>hello</p>') // hello

removeByTag

parse a specific tag from a string

parms: (string, tag)

tagless.removeByTag('<p>hello</p>', 'p') // hello

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please open an issue or submit a pull request.

Author

Mahmoud Ibrahiam

About

Tagless is a library that remove html tags from string, it's useful for sanitizing user input

Topics

Resources

License

Stars

Watchers

Forks