html-get 2.24.1 → 2.24.3
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 +1 -1
- package/src/html.js +8 -9
- package/src/index.js +3 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "html-get",
|
|
3
3
|
"description": "Get the HTML from any website, fine-tuned for correction & speed",
|
|
4
4
|
"homepage": "https://nicedoc.com/microlinkhq/html-get",
|
|
5
|
-
"version": "2.24.
|
|
5
|
+
"version": "2.24.3",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"main": "src/index.js",
|
|
8
8
|
"bin": {
|
package/src/html.js
CHANGED
|
@@ -142,15 +142,14 @@ const replaceCssUrls = (url, stylesheet) => {
|
|
|
142
142
|
)
|
|
143
143
|
|
|
144
144
|
cssUrls.forEach(cssUrl => {
|
|
145
|
-
if (
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
145
|
+
if (/^(?:https?|data):/.test(cssUrl)) return
|
|
146
|
+
try {
|
|
147
|
+
const absoluteUrl = new URL(cssUrl, url).toString()
|
|
148
|
+
stylesheet = stylesheet.replaceAll(
|
|
149
|
+
`url(${cssUrl})`,
|
|
150
|
+
`url(${absoluteUrl})`
|
|
151
|
+
)
|
|
152
|
+
} catch (_) {}
|
|
154
153
|
})
|
|
155
154
|
|
|
156
155
|
return stylesheet
|
package/src/index.js
CHANGED