X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/ed38c6a76767a893a319f7bfd9229b0dad6b08db..072ed096973a4acca34602462ffd711752d985c3:/article.inc.php diff --git a/article.inc.php b/article.inc.php index d8ddf77..98cd475 100644 --- a/article.inc.php +++ b/article.inc.php @@ -22,7 +22,7 @@ class ArchiveArticle function __construct($path) { $this->page = preg_replace('{^\.(?:/|$)}', '', $path); - $this->link = preg_replace('{(?:/index)?\.html$}', '', $this->page); + $this->link = preg_replace('{(?:(?:/|^)index)?\.html$}', '', $this->page); $this->raw($this->page); } @@ -110,7 +110,7 @@ class ArchiveArticle function story() { if ( preg_match('{ - \n (?: < (?: p | figure [^>]* ) >\s* )+ (]*>) | \n
|
\s* (.*?)
- }sx', $this->raw, $bodyp, PREG_OFFSET_CAPTURE)) { - # fallback paragraph contents following the page header - if ($bodyp[1][1] < 256) { - return $bodyp[1][0]; - } - } - - # starting paragraph for documents without title (assumed simple/partial) - if (strpos($this->raw, '\s* (.*?)
- }sx', $this->raw, $bodyp)) { + \G (?> \s+ |