From d4234d6011571ada7dd9323ede99ecd8e3c3202d Mon Sep 17 00:00:00 2001 From: Martin Donnelly Date: Sat, 2 May 2020 13:25:50 +0100 Subject: [PATCH] Added highlighting of inserted text --- scrapers/scraper.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scrapers/scraper.js b/scrapers/scraper.js index 563270b..3fd2c4d 100644 --- a/scrapers/scraper.js +++ b/scrapers/scraper.js @@ -136,6 +136,8 @@ class ChangeDetection extends Scraper { async processItem(item) { logger.debug(`Processing ${item.name}...`); + const insRegEx = //g; + const now = new Date(); const filename = _.kebabCase(item.name); const oldFile = `${this.path}/${filename}.html`; @@ -187,6 +189,8 @@ class ChangeDetection extends Scraper { stats.levenshtein = levenshtein; stats.since = time.since(new Date(stats.previousChange)).days(); + stats.changed = stats.changed.replace(insRegEx, ``); + await this._makeScreenshotV2(this.page, screenshotPath, null); stats.diffPNG = await this.generateDiffScreenshotV2(stats.previousScreenshot.concat('.png'), screenshotPath.concat('.png'));