mirror of
https://github.com/danpros/htmly.git
synced 2026-04-21 13:06:22 +05:30
Merge pull request #99 from Kanti/master
Bug-fix: empty description by @Kanti.
This commit is contained in:
commit
3a3eb8b29c
1 changed files with 10 additions and 5 deletions
|
|
@ -238,13 +238,14 @@ function get_posts($posts, $page = 1, $perpage = 0) {
|
|||
$post->tagb = implode(' » ', $bc);
|
||||
|
||||
$post->file = $filepath;
|
||||
|
||||
// Get the contents and convert it to HTML
|
||||
$content = MarkdownExtra::defaultTransform(file_get_contents($filepath));
|
||||
|
||||
$content = file_get_contents($filepath);
|
||||
|
||||
// Extract the title and body
|
||||
$post->title = get_content_tag('t', $content, 'Untitled: ' . date('l jS \of F Y', $post->date));
|
||||
$post->body = remove_html_comments($content);
|
||||
|
||||
// Get the contents and convert it to HTML
|
||||
$post->body = MarkdownExtra::defaultTransform(remove_html_comments($content));
|
||||
|
||||
if (config("views.counter")) {
|
||||
$post->views = get_views($post->file);
|
||||
|
|
@ -1711,7 +1712,11 @@ function get_content_tag($tag, $string, $alt = null) {
|
|||
$ary = array();
|
||||
if (preg_match($reg, $string, $ary)) {
|
||||
if (isset($ary[1])) {
|
||||
return trim($ary[1]);
|
||||
$result = trim($ary[1]);
|
||||
if(!empty($result))
|
||||
{
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $alt;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue