Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fast-mhtml

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-mhtml - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

.nyc_output/0d8e58c5-906d-4e54-b93a-daf9b2cf8c41.json

3

package.json
{
"name": "fast-mhtml",
"version": "1.1.1",
"version": "1.1.2",
"description": "Parses mhtml files",
"main": "src/index.js",
"types": "src/index.d.ts",
"scripts": {

@@ -7,0 +8,0 @@ "test": "nyc --reporter=html mocha src/*.test.js",

@@ -148,3 +148,3 @@ const { URL } = require('url'); // url isn't global in Node < 8

if (attribute === attrs.STYLE) {
value = this.cssProcessor ? this.cssProcessor(fromHtml, this.mapping, this.baseUrl) : fromHtml;
value = this.cssProcessor ? this.cssProcessor(fromHtml, this.mapping, this.baseUrl, true) : fromHtml;
} else if (tagName === 'base') {

@@ -247,2 +247,3 @@ this.baseUrl = new URL(fromHtml, this.baseUrl);

}
/* istanbul ignore next unreachable */
return false;

@@ -270,3 +271,3 @@ }

} else { // unescaped
while (!isWhitespace(this.current()) && this.lenOk()) {
while (!isWhitespace(this.current()) && !(this.current() === c.ANGLE_CLOSE) && this.lenOk()) {
this.addAndProgress();

@@ -283,6 +284,6 @@ }

}
this.i++; // rread the quote
this.i++; // read the quote
return this.data.toString('utf8', initial, this.i - 1);
} // unescaped
while (!isWhitespace(this.current()) && this.lenOk()) {
while (!isWhitespace(this.current()) && (this.current() !== c.ANGLE_CLOSE) && this.lenOk()) {
this.i++;

@@ -319,3 +320,3 @@ }

if (isData(data[initial], data[initial + 1], data[initial + 2], data[initial + 3])) {
return attrs.Data;
return attrs.DATA;
}

@@ -322,0 +323,0 @@ return attrs.OTHER;

@@ -39,3 +39,9 @@ const cheerio = require('cheerio');

},
css(cssString, resourcesMap, baseUrl) {
css(cssString, resourcesMap, baseUrl, inAttribute = false) {
let start = "url('";
let end = "')";
if (inAttribute) {
start = 'url(&quot;';
end = '&quot;)';
}
return cssString.toString().replace(CSS_REPLACE_RE, (whole, match) => {

@@ -48,3 +54,3 @@ if (match.charAt(0) === '/' && match.charAt(1) === '/') { // protocol agnostic URL

/* eslint-disable prefer-template */ // hot point
return "url('" + mapped + "')";
return start + mapped + end;
});

@@ -51,0 +57,0 @@ },

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc