From 48636b3d4413f0eecb97464fb6214bf36b77a27d Mon Sep 17 00:00:00 2001 From: Jakub Kotek Date: Wed, 27 Dec 2017 00:03:36 +0100 Subject: [PATCH] regexps for images - add webp and remove $ It is necessary to have $ at the end of reqex? Images with src like "/images/for.png?1716226" (some kind of cache busting) are not recognized now. Also I suggest add webp because is quite popular nowadays. --- lib/reader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/reader.js b/lib/reader.js index cb9c0b5..68e5f69 100644 --- a/lib/reader.js +++ b/lib/reader.js @@ -22,7 +22,7 @@ var extRegexps = { maybe: /and|article|body|column|main|column/i, div2p: /<(a|blockquote|dl|div|img|ol|p|pre|table|ul|span|font|label)/i, uselessAnchors: /(\d+|next|prev|first|last|print|comment|mail|font|about|contact|(下|下|前|后)一|(首|尾)页)|打印|评论|邮件|信箱|转发|关于|联系|^(大|中|小)$/i, - images: /\.(gif|jpe?g|png)$/i + images: /\.(gif|jpe?g|png|webp)/i } var tagsToSkip = '' var tagsOfMedia = ''