You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
974 B

4 years ago
  1. # [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]
  2. > Regular expression for matching HTML comments
  3. ## Install
  4. ```sh
  5. $ npm install --save html-comment-regex
  6. ```
  7. ## Usage
  8. ```js
  9. var htmlCommentRegex = require('html-comment-regex');
  10. htmlCommentRegex.test('<!DOCTYPE html><!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--><html lang="en"><head><meta charset="UTF-8"><title>Document</title></head><body></body></html>');
  11. //=> true
  12. htmlCommentRegex.test('<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>Document</title></head><body></body></html>');
  13. //=> false
  14. ```
  15. ## License
  16. MIT © [Steve Mao](https://github.com/stevemao)
  17. [npm-image]: https://badge.fury.io/js/html-comment-regex.svg
  18. [npm-url]: https://npmjs.org/package/html-comment-regex
  19. [travis-image]: https://travis-ci.org/stevemao/html-comment-regex.svg?branch=master
  20. [travis-url]: https://travis-ci.org/stevemao/html-comment-regex