-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Steve Mao
committed
May 21, 2015
0 parents
commit 2dbb3be
Showing
10 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,12 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1 @@ | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,2 @@ | ||
/node_modules/ | ||
npm-debug.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,5 @@ | ||
{ | ||
"preset": "google", | ||
"maximumLineLength": null, | ||
"excludeFiles": ["node_modules/**"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,15 @@ | ||
{ | ||
"boss": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"eqnull": true, | ||
"immed": true, | ||
"latedef": true, | ||
"mocha" : true, | ||
"newcap": true, | ||
"noarg": true, | ||
"node": true, | ||
"sub": true, | ||
"undef": true, | ||
"unused": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,6 @@ | ||
sudo: false | ||
language: node_js | ||
node_js: | ||
- 'iojs' | ||
- '0.12' | ||
- '0.10' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,34 @@ | ||
# [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] | ||
|
||
> Regular expression for matching HTML comments | ||
|
||
## Install | ||
|
||
```sh | ||
$ npm install --save html-comment-regex | ||
``` | ||
|
||
|
||
## Usage | ||
|
||
```js | ||
var htmlCommentRegex = require('html-comment-regex'); | ||
|
||
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>'); | ||
//=> true | ||
|
||
htmlCommentRegex.test('<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>Document</title></head><body></body></html>'); | ||
//=> false | ||
``` | ||
|
||
|
||
## License | ||
|
||
MIT © [Steve Mao](https://github.com/stevemao) | ||
|
||
|
||
[npm-image]: https://badge.fury.io/js/html-comment-regex.svg | ||
[npm-url]: https://npmjs.org/package/html-comment-regex | ||
[travis-image]: https://travis-ci.org/stevemao/html-comment-regex.svg?branch=master | ||
[travis-url]: https://travis-ci.org/stevemao/html-comment-regex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,2 @@ | ||
'use strict'; | ||
module.exports = /(<!--(?:.|\s)*?-->)/g; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,43 @@ | ||
{ | ||
"name": "html-comment-regex", | ||
"version": "0.0.0", | ||
"description": "Regular expression for matching HTML comments", | ||
"homepage": "https://github.com/stevemao/html-comment-regex", | ||
"author": { | ||
"name": "Steve Mao", | ||
"email": "[email protected]", | ||
"url": "https://github.com/stevemao" | ||
}, | ||
"repository": "stevemao/html-comment-regex", | ||
"license": "MIT", | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"html-comment-regex", | ||
"text", | ||
"string", | ||
"regex", | ||
"regexp", | ||
"re", | ||
"match", | ||
"test", | ||
"find", | ||
"pattern", | ||
"comment", | ||
"comments", | ||
"html", | ||
"HTML", | ||
"HyperText Markup Language" | ||
], | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"jscs": "^1.11.3", | ||
"jshint": "^2.6.3", | ||
"mocha": "*" | ||
}, | ||
"scripts": { | ||
"lint": "jshint *.js --exclude node_modules && jscs *.js", | ||
"test": "npm run-script lint && mocha" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,14 @@ | ||
'use strict'; | ||
var assert = require('assert'); | ||
var htmlCommentRegex = require('./'); | ||
|
||
var html = '<!DOCTYPE html><!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--><!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--><!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--><!--[if gt IE 8]><!--><html lang="en"><head><meta charset="UTF-8"><title>Document</title></head><body></body></html>'; | ||
|
||
it('html should match the regex', function() { | ||
assert.deepEqual(html.match(htmlCommentRegex), [ | ||
'<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->', | ||
'<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->', | ||
'<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->', | ||
'<!--[if gt IE 8]><!-->' | ||
]); | ||
}); |