Beispiel #1
0
 public function onRefreshPreview()
 {
     $data = post('Post');
     $previewHtml = Post::formatHtml($data['content'], true);
     return ['preview' => $previewHtml];
 }
 /**
  * Get the post's excerpt if available
  * otherwise fall back to a limited content string.
  *
  * @param $post
  *
  * @return string
  */
 private function getSummary($post)
 {
     $excerpt = $post->excerpt;
     if (mb_strlen(trim($excerpt))) {
         return $excerpt;
     }
     $content = $post->content;
     if (Settings::get('markdownMode')) {
         $content = Post::formatHtml($content);
     }
     return $content;
 }