mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-11-11 07:41:04 +00:00
Fixes the issue with "/"'s in the page title
This commit resolves an bug where the page title would cause a filepaths issue due to it having a forward slash. The code committed here uses a simple regular expression to find all instances of forward slashes in the page title and replace them with an empty string. Resolves #22 For more on this, please see: https://github.com/jiahaog/nativefier/issues/22
This commit is contained in:
parent
762de5f1c8
commit
64b4f8b2a5
@ -103,7 +103,7 @@ function getTitle(url, callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const $ = cheerio.load(body);
|
const $ = cheerio.load(body);
|
||||||
const pageTitle = $("title").text();
|
const pageTitle = $("title").text().replace(/\//g, "");
|
||||||
callback(null, pageTitle);
|
callback(null, pageTitle);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user