converter = new HtmlConverter(array(
'strip_tags' => false
));
}
/**
* Converts a post into markdown.
* @param WP_Post $post The post to be converted
* @return string
*/
public function convert_to_markdown($post)
{
// $title = '
' . $post->post_title . '
';
//
// $featured_image = get_the_post_thumbnail($post);
//
// $content = $title;
// if ($featured_image) {
// $content .= $featured_image . '
';
// }
$content = apply_filters('the_content', $post->post_content);
$converted = $this->converter->convert($content);
return $converted;
}
}