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:
dlunny 2016-01-20 16:54:54 -05:00
parent 762de5f1c8
commit 64b4f8b2a5
1 changed files with 1 additions and 1 deletions

View File

@ -103,7 +103,7 @@ function getTitle(url, callback) {
}
const $ = cheerio.load(body);
const pageTitle = $("title").text();
const pageTitle = $("title").text().replace(/\//g, "");
callback(null, pageTitle);
});
}