From eb72a315c42684841a75ab31fb3994d6193a73e5 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Fri, 29 Oct 2021 15:36:19 +0200 Subject: [PATCH] Clean empty figure tags without ending See 'Tag omission' https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figure Signed-off-by: Kevin Decherf --- src/Readability.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Readability.php b/src/Readability.php index ebf6844..1ed93ea 100644 --- a/src/Readability.php +++ b/src/Readability.php @@ -157,7 +157,7 @@ class Readability implements LoggerAwareInterface // replace excessive br's '/\s*

']+/>!is' => '', + '!<(?:a|div|p|figure)[^>]+/>!is' => '', // remove all attributes on text tags //'!<(\s*/?\s*(?:blockquote|br|hr|code|div|article|span|footer|aside|p|pre|dl|li|ul|ol)) [^>]+>!is' => "<\\1>", //single newlines cleanup