is-html
Check if a string is HTML
Last updated 8 months ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install is-html 
SYNC missed versions from official npm registry.

is-html

Check if a string is HTML

You should not use this for any kind of validation, sanitation, or XSS checks.

Install

npm install is-html

Usage

import isHtml from 'is-html';

isHtml('<p>I am HTML</p>');
//=> true

isHtml('<!doctype><html><body><h1>I ❤ unicorns</h1></body></html>');
//=> true

isHtml('<cake>I am XML</cake>');
//=> false

isHtml('>+++++++>++++++++++>+++>+<<<<-');
//=> false

Note: It does not detect deprecated HTML tags.

Current Tags

  • 3.1.0                                ...           latest (8 months ago)

9 Versions

  • 3.1.0                                ...           8 months ago
  • 3.0.0                                ...           3 years ago
  • 2.0.0                                ...           5 years ago
  • 1.1.0                                ...           8 years ago
  • 1.0.0                                ...           10 years ago
  • 0.2.2                                ...           11 years ago
  • 0.2.1                                ...           11 years ago
  • 0.1.1                                ...           11 years ago
  • 0.1.0                                ...           11 years ago
Maintainers (1)
Downloads
Total 3
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE