Skip to content

MykolaPrymak/strip

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

strip

Strips HTML tags.

Install

$ npm install strip

Usage

strip('<p> hello <a href="http://foo.com/?q=123">world</a> </p>');
// => Hello World

strip('<p>My name is <b>Jon</b>.</p>');
// => Retrun "My name is Jon."

strip('<p>My name is <b>Jon</b>.</p><p>I love <a href="en.wikipedia/wiki/dogs">dogs</a>.</p>');
// => Retrun "My name is Jon. I love dogs."

strip('<p>My name is <b>Jon</b>.</p><p>I love <a href="en.wikipedia/wiki/dogs">dogs</a>.</p>', 'a');
// => "My name is Jon. I love <a href="en.wikipedia/wiki/dogs">dogs</a>."

strip('<p>My name is <b>Jon</b>.</p><p>I love <a href="en.wikipedia/wiki/dogs">dogs</a>.</p>', 'a|b');
// => "My name is <b>Jon</b>. I love <a href="en.wikipedia/wiki/dogs">dogs</a>."

About

Strip HTML Tags

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%