trim-html-tag

trim html tag from input

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
trim-html-tag
311.0.58 years ago8 years agoMinified + gzip package size for trim-html-tag in KB

Readme

trim-html-tag
!NPM versionnpm-imagenpm-url !Build Statustravis-imagetravis-url !Coveralls Statuscoveralls-imagecoveralls-url !Dependency Statusdepstat-imagedepstat-url
trim html tag from input

Install

npm install --save trim-html-tag

Usage

import trimTag from 'trim-html-tag';

trimTag('<p> trimP </p>\n');    // trimP
trimTag('<h1> trimH1 </h1>\n'); // trimH1
trimTag('<h1 class="asd"> trimH1 </h1>\n'); // trimH1
trimTag('<p>stringified <em>stay here</em></h1>\n'); // stringified <em>stay here</em>

trimTag();       // undefined ¯\_(ツ)_/¯
trimTag('some'); // some

API

trimTag(input)

input

Required
Type: String
One stringified HTML node, from which you want to trim the tag (e.g. <p>inside</p> or <h1>also inside</h1>).

License

MIT © Vladimir Starkov