X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/992858b68f3a1feaae7940026676497f74cdbdcf..f2df190a6c4a0128eb351bc398cffd0edf8d6096:/article.inc.php diff --git a/article.inc.php b/article.inc.php index dd3d5b2..dbc545f 100644 --- a/article.inc.php +++ b/article.inc.php @@ -128,19 +128,12 @@ class ArchiveArticle return $override; } + # paragraph contents following the page header if any + $offset = strpos($this->raw, ''); + $offset = $offset ? $offset + 5 : 0; if (preg_match('{ - (?: \s+ | | ]*> )*

\s* (.*?)

- }sx', $this->raw, $bodyp, PREG_OFFSET_CAPTURE)) { - # fallback paragraph contents following the page header - if ($bodyp[1][1] < 512) { - return $bodyp[1][0]; - } - } - - # starting paragraph for documents without title (assumed simple/partial) - if (strpos($this->raw, ']*> \s* )*

\s* (.*?)

- }sx', $this->raw, $bodyp)) { + \G (?: \s+ | |
]*> )*

\s* (.*?)

+ }sx', $this->raw, $bodyp, 0, $offset)) { return $bodyp[1]; } }