X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/4f5fbaf255247b3b7d6285313a1a587c42a432f3..f0a0679f7ec71d6ae4969d39da4d6be84147fcb4:/article.inc.php diff --git a/article.inc.php b/article.inc.php index 336511e..e3a3ee8 100644 --- a/article.inc.php +++ b/article.inc.php @@ -82,8 +82,20 @@ class ArchiveArticle } function teaser() { - if (preg_match('{

(.*?)

}s', $this->story, $bodyp)) { - return $bodyp[1]; + if (preg_match('{ + ]* content="([^">]*)" + }x', $this->preface, $meta)) { + # prefer specific page description if found (assume before title) + #TODO: strip from body contents + return $meta[1]; + } + if (preg_match('{ + (?: \s+ | | ]*> )*

(.*?)

+ }sx', $this->raw, $bodyp, PREG_OFFSET_CAPTURE)) { + # fallback paragraph contents following the page header + if ($bodyp[1][1] < 256) { + return $bodyp[1][0]; + } } }