Comparing version 1.2.0 to 2.0.0
14
index.js
@@ -1,3 +0,1 @@ | ||
var $ = require("cheerio"); | ||
function cockblock(html, options) { | ||
@@ -7,2 +5,10 @@ return sanitizeHtml(html, options || cockblock.defaults); | ||
function $wrap(value) { | ||
if (!cockblock.$) { | ||
throw new Error("cockblock.$ must be set to cheerio to jquery"); | ||
} | ||
return cockblock.$(value); | ||
} | ||
cockblock.url = function(url, options) { | ||
@@ -160,3 +166,3 @@ return sanitizeResource(url, options || cockblock.defaults); | ||
function sanitizeHtml(html, options) { | ||
var $wrapper = $("<body>"); | ||
var $wrapper = $wrap("<body>"); | ||
$wrapper.html(html); | ||
@@ -196,3 +202,3 @@ sanitizeChildren($wrapper, initializeOptions(options)); | ||
$el.children().each(function() { | ||
sanitizeElement($(this), options); | ||
sanitizeElement($wrap(this), options); | ||
}); | ||
@@ -199,0 +205,0 @@ } |
{ | ||
"name": "cockblock", | ||
"version": "1.2.0", | ||
"version": "2.0.0", | ||
"homepage": "http://github.com/rymohr/cockblock", | ||
@@ -25,11 +25,10 @@ "repository": "http://github.com/rymohr/cockblock", | ||
"main": "index.js", | ||
"dependencies": { | ||
"cheerio": "*" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"jquery": "*", | ||
"browserify": "~9.0.3", | ||
"browserify-shim": "~3.8.3", | ||
"chai": "~1.9.0", | ||
"mocha": "~1.17.1", | ||
"browserify": "~9.0.3", | ||
"browserify-shim": "~3.8.3" | ||
"cheerio": "^0.22.0", | ||
"jquery": "^3.2.1", | ||
"mocha": "~1.17.1" | ||
}, | ||
@@ -36,0 +35,0 @@ "browserify": { |
var expect = require("chai").expect; | ||
var cockblock = require(".."); | ||
cockblock.$ = require("cheerio"); | ||
describe("cockblock()", function() { | ||
@@ -5,0 +7,0 @@ function html(given, expected) { |
Sorry, the diff of this file is too big to display
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
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
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
505629
0
11
14643
1
6
- Removedcheerio@*
- Removedboolbase@1.0.0(transitive)
- Removedcheerio@1.0.0(transitive)
- Removedcheerio-select@2.1.0(transitive)
- Removedcss-select@5.1.0(transitive)
- Removedcss-what@6.1.0(transitive)
- Removeddom-serializer@2.0.0(transitive)
- Removeddomelementtype@2.3.0(transitive)
- Removeddomhandler@5.0.3(transitive)
- Removeddomutils@3.1.0(transitive)
- Removedencoding-sniffer@0.2.0(transitive)
- Removedentities@4.5.0(transitive)
- Removedhtmlparser2@9.1.0(transitive)
- Removediconv-lite@0.6.3(transitive)
- Removednth-check@2.1.1(transitive)
- Removedparse5@7.2.1(transitive)
- Removedparse5-htmlparser2-tree-adapter@7.1.0(transitive)
- Removedparse5-parser-stream@7.1.2(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedundici@6.21.0(transitive)
- Removedwhatwg-encoding@3.1.1(transitive)
- Removedwhatwg-mimetype@4.0.0(transitive)