X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/15a408fca4266bcfd04289cb2d21af5057120035..bd940f48a9b1c6fb45aef4860d3f23b8094d5ba4:/article.inc.php
diff --git a/article.inc.php b/article.inc.php
index da18368..93bbe3b 100644
--- a/article.inc.php
+++ b/article.inc.php
@@ -16,13 +16,13 @@ function showdate($parts)
class ArchiveArticle
{
- public $raw, $preface, $title, $body;
- public $meta = [];
+ public $raw, $title, $body; # file contents
+ public $meta = []; # head metadata properties
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);
}
@@ -41,8 +41,11 @@ class ArchiveArticle
$this->meta = array_combine($meta[1], $meta[2]); # [property => content]
}
- @list ($this->preface, $this->title, $this->body) =
- preg_split('{
(.*?)
\s*}s', $this->raw, 2, PREG_SPLIT_DELIM_CAPTURE);
+ // find significant contents
+ $this->body = preg_replace('{