is-html
Check if a string is HTML
Last updated 8 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm 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.0.0                                ...           latest (3 years ago)

8 Versions

  • 3.0.0                                ...           3 years ago
  • 2.0.0                                ...           6 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
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (1)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |