From: Vsevolod Stakhov Date: Tue, 7 Sep 2021 14:00:58 +0000 (+0100) Subject: [Rules] Improve zero font rule X-Git-Tag: 3.1~189 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d2ca78731396d34148d3b2ab1d0503d07621557b;p=thirdparty%2Frspamd.git [Rules] Improve zero font rule --- diff --git a/rules/html.lua b/rules/html.lua index 58fabfd7ae..6427a325ab 100644 --- a/rules/html.lua +++ b/rules/html.lua @@ -198,11 +198,11 @@ local vis_check_id = rspamd_config:register_symbol{ hc:foreach_tag({'font', 'span', 'div', 'p', 'td'}, function(tag, clen, is_leaf) local bl = tag:get_style() if bl then - if not bl.visible and is_leaf then + if not bl.visible and clen > 0 and is_leaf then invisible_blocks = invisible_blocks + 1 end - if (bl.font_size or 12) == 0 and is_leaf then + if (bl.font_size or 12) == 0 and clen > 0 and is_leaf then zero_size_blocks = zero_size_blocks + 1 end