Merge dee3ec7cfe
into 69d67b2b71
This commit is contained in:
commit
6c9dffb996
1 changed files with 12 additions and 0 deletions
12
lib/pico.php
12
lib/pico.php
|
@ -167,6 +167,18 @@ class Pico {
|
|||
}
|
||||
|
||||
if($headers['date']) $headers['date_formatted'] = date($config['date_format'], strtotime($headers['date']));
|
||||
|
||||
if(empty($headers['title'])){
|
||||
preg_match('/^(.+?)[ ]*\n(=+|-+)[ ]*\n+/imu',$content,$matches);
|
||||
if(count($matches) > 0){
|
||||
$headers['title'] = $matches[1];
|
||||
}else{
|
||||
preg_match('/^\#{1}([^\#].*)$/imu',$content,$matches);
|
||||
if(count($matches) > 0){
|
||||
$headers['title'] = $matches[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $headers;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue