From 64b4f8b2a5535d55f1040f497af8b706a846eff2 Mon Sep 17 00:00:00 2001 From: dlunny Date: Wed, 20 Jan 2016 16:54:54 -0500 Subject: [PATCH] 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 --- src/options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/options.js b/src/options.js index 40f7778..d787c93 100644 --- a/src/options.js +++ b/src/options.js @@ -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); }); }