From: Mischa POSLAWSKY Date: Sat, 2 Mar 2019 18:10:52 +0000 (+0100) Subject: nieuws: split intro before nested figure containers X-Git-Tag: v3.9~3 X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/cd52370f65beeb38f283fbe072c48638ce68629c nieuws: split intro before nested figure containers Fix invalid html due to captured consecutive
from contents. --- 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]; }