public function beforeSave()
 {
     if (ProblogSettingsModel::get('markdownMode', false)) {
         $this->content_markdown = $this->content;
         $this->content = $this->formatHtml($this->content);
     }
 }
 public function formExtendFieldsBefore($widget)
 {
     if (ProblogSettingsModel::get('markdownMode', false)) {
         $widget->tabs['fields']['content']['type'] = 'markdown';
     }
 }
 /**
  * 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;
 }