From cd52370f65beeb38f283fbe072c48638ce68629c Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sat, 2 Mar 2019 19:10:52 +0100 Subject: [PATCH] nieuws: split intro before nested figure containers Fix invalid html due to captured consecutive
from contents. --- nieuws.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nieuws.inc.php b/nieuws.inc.php index a0fa821..1a68993 100644 --- a/nieuws.inc.php +++ b/nieuws.inc.php @@ -78,7 +78,9 @@ class ArchiveArticle { $this->title; $rest = fread($this->file, filesize($this->page)); - if ( preg_match('{\n < (?: p | figure [^>]* ) > (]*>) | \n }x', $rest, $img, PREG_OFFSET_CAPTURE) ) { + if ( preg_match('{ + \n (?: < (?: p | figure [^>]* ) >\s* )+ (]*>) | \n + }x', $rest, $img, PREG_OFFSET_CAPTURE) ) { if (isset($img[1])) { $this->img = $img[1][0]; } -- 2.30.0