html-non-conditional-comment-regex

1.0.0 • Public • Published

NPM version Build Status

Regular expression for matching non conditional HTML comments

Install

$ npm install --save html-non-conditional-comment-regex

Usage

var htmlNonConditionalCommentRegex = require('html-non-conditional-comment-regex');
 
htmlNonConditionalCommentRegex.test('<!DOCTYPE html><!--\nnormal comment \n--><html lang="en"><head><meta charset="UTF-8"><title>Document</title></head><body></body></html>');
//=> true
 
htmlNonConditionalCommentRegex.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>');
//=> false

License

MIT © Steve Mao

Package Sidebar

Install

npm i html-non-conditional-comment-regex

Weekly Downloads

4

Version

1.0.0

License

MIT

Last publish

Collaborators

  • stevemao