void-elements
Advanced tools
Comparing version 1.0.0 to 2.0.0
@@ -0,0 +0,0 @@ /** |
{ | ||
"name": "void-elements", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "Array of \"void elements\" defined by the HTML specification.", | ||
@@ -26,5 +26,4 @@ "main": "index.js", | ||
"devDependencies": { | ||
"cheerio": "^0.17.0", | ||
"superagent": "^0.18.2" | ||
"cheerio": "^0.18.0" | ||
} | ||
} |
@@ -1,8 +0,11 @@ | ||
var cheerio = require('cheerio'); | ||
var superagent = require('superagent'); | ||
var cheerio = require('cheerio') | ||
, http = require('http'); | ||
superagent | ||
.get('http://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements') | ||
.end(function (err, res) { | ||
var $ = cheerio.load(res.text); | ||
http.get('http://www.w3.org/html/wg/drafts/html/master/syntax.html', function (res) { | ||
var str = ''; | ||
res.setEncoding('utf8'); | ||
res.on('data', function (buf) { | ||
str += buf; | ||
}).on('end', function () { | ||
var $ = cheerio.load(str); | ||
var codes = $('dfn#void-elements') | ||
@@ -13,6 +16,10 @@ .parent() | ||
.replace(/\s/gm,'') | ||
.split(","); | ||
.split(",") | ||
.reduce(function (obj, code) { | ||
obj[code] = true; | ||
return obj; | ||
}, {}); | ||
console.log('/**'); | ||
console.log(' * This file automatically generated from `build.js`.'); | ||
console.log(' * This file automatically generated from `pre-publish.js`.'); | ||
console.log(' * Do not manually edit.'); | ||
@@ -23,1 +30,2 @@ console.log(' */'); | ||
}); | ||
}); |
@@ -8,7 +8,7 @@ void-elements | ||
The list is programatically generated from [SPEC](http://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements). | ||
The list is programatically generated from the [latest W3C HTML draft](http://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements). | ||
[![Build Status](https://img.shields.io/travis/hemanth/void-elements/master.svg)](https://travis-ci.org/hemanth/void-elements) | ||
[![Dependency Status](https://img.shields.io/gemnasium/hemanth/void-elements.svg)](https://gemnasium.com/hemanth/void-elements) | ||
[![NPM version](https://img.shields.io/npm/v/void-elements.svg)](https://www.npmjs.org/package/void-elements) | ||
[![Build Status](https://img.shields.io/travis/jadejs/void-elements/master.svg?style=flat)](https://travis-ci.org/jadejs/void-elements) | ||
[![Developing Dependency Status](https://img.shields.io/david/dev/jadejs/void-elements.svg?style=flat)](https://david-dm.org/jadejs/void-elements#info=devDependencies) | ||
[![NPM version](https://img.shields.io/npm/v/void-elements.svg?style=flat)](https://www.npmjs.org/package/void-elements) | ||
@@ -15,0 +15,0 @@ Usage |
var assert = require('assert'); | ||
var voidElements = require('../'); | ||
assert(voidElements.indexOf('span') === -1, '<span> is not a void element'); | ||
assert(voidElements.indexOf('img') !== -1, '<img> is a void element'); | ||
assert(!voidElements.span, '<span> is not a void element'); | ||
assert(voidElements.img, '<img> is a void element'); | ||
console.log('tests passed'); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4269
1
54
1