the
This commit is contained in:
parent
8e822aba75
commit
6a6bfab5f6
1 changed files with 10 additions and 1 deletions
11
site.js
11
site.js
|
@ -43,11 +43,20 @@ async function urlCollector(url, path, file, useLimit, data2) {
|
|||
let h = body(link).attr('href');
|
||||
if (!h) return true;
|
||||
h = h.trim();
|
||||
if (h.startsWith('./') || h.startsWith('../') || h.startsWith('/')) {
|
||||
if (h.startsWith('./') || h.startsWith('../') || h.startsWith('/')) {
|
||||
let u = new URL(url);
|
||||
u.pathname = h;
|
||||
h = u.toString();
|
||||
}
|
||||
if (h.startsWith('?')) {
|
||||
let u = new URL(url);
|
||||
u.search = h;
|
||||
h = u.toString();
|
||||
}
|
||||
if (h.startsWith('#')) {
|
||||
let u = new URL(url);
|
||||
h = u.toString();
|
||||
}
|
||||
let h2;
|
||||
try {
|
||||
h2 = new URL(h);
|
||||
|
|
Loading…
Reference in a new issue