html-get 2.9.7 → 2.9.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "html-get",
3
3
  "description": "Get the HTML from any website, using prerendering when is necessary.",
4
4
  "homepage": "https://nicedoc.com/microlinkhq/html-get",
5
- "version": "2.9.7",
5
+ "version": "2.9.8",
6
6
  "main": "src/index.js",
7
7
  "bin": {
8
8
  "html-get": "bin/index.js"
@@ -3,35 +3,35 @@
3
3
  "youtube",
4
4
  "apple",
5
5
  "microsoft",
6
- "wordpress",
7
6
  "wikipedia",
7
+ "wordpress",
8
8
  "blogspot",
9
9
  "vimeo",
10
10
  "github",
11
- "bbc",
12
11
  "nytimes",
13
- "slideshare",
14
12
  "imdb",
15
13
  "theguardian",
14
+ "bbc",
15
+ "slideshare",
16
+ "huffingtonpost",
16
17
  "telegraph",
17
18
  "pinterest",
18
- "huffingtonpost",
19
- "techcrunch",
20
- "zoom",
21
- "yelp",
19
+ "soundcloud",
20
+ "eventbrite",
22
21
  "engadget",
23
22
  "spotify",
24
- "eventbrite",
23
+ "yelp",
24
+ "zoom",
25
+ "techcrunch",
25
26
  "theverge",
26
- "soundcloud",
27
+ "etsy",
28
+ "imgur",
27
29
  "stackoverflow",
28
- "giphy",
30
+ "csdn",
29
31
  "digg",
30
32
  "flickr",
31
- "csdn",
32
- "etsy",
33
33
  "ghost",
34
- "imgur",
34
+ "giphy",
35
35
  "meetup",
36
36
  "producthunt",
37
37
  "reddit",
package/src/html.js CHANGED
@@ -97,7 +97,7 @@ const rewriteCssUrls = ({ html, url }) => {
97
97
  if (cssUrl.startsWith('/')) {
98
98
  try {
99
99
  const absoluteUrl = new URL(cssUrl, url).toString()
100
- html = replaceString(html, cssUrl, absoluteUrl)
100
+ html = replaceString(html, `url(${cssUrl})`, `url(${absoluteUrl})`)
101
101
  } catch (_) {}
102
102
  }
103
103
  })
@@ -141,7 +141,7 @@ module.exports = ({
141
141
 
142
142
  const $ = cheerio.load(content)
143
143
 
144
- if (rewriteUrls) rewriteHtmlUrls({ $, url, headers })
144
+ if (rewriteUrls) rewriteHtmlUrls({ $, url })
145
145
 
146
146
  addHead({ $, url, headers })
147
147
 
@@ -164,7 +164,7 @@ module.exports = ({
164
164
  if (scripts) injectScripts({ $, scripts, type: 'text/javascript' })
165
165
  if (modules) injectScripts({ $, modules, type: 'module' })
166
166
 
167
- return rewriteCssUrls({ html: $.html(), url })
167
+ return rewriteUrls ? rewriteCssUrls({ html: $.html(), url }) : $.html()
168
168
  }
169
169
 
170
170
  module.exports.isHTML = isHTML