';
$content = $thumbnail . '
' . $jsonItem['content'];
// Markdown parsing from https://gist.github.com/jbroadway/2836900
// Line breaks
$content = preg_replace("/\r\n|\r|\n/", '
', $content);
// Links
$regex = '/\[([^\[]+)\]\(([^\)]+)\)/';
$replacement = '\1';
$content = preg_replace($regex, $replacement, $content);
// Bold text
$regex = '/(\*\*|__)(.*?)\1/';
$replacement = '\2';
$content = preg_replace($regex, $replacement, $content);
// Lists
$regex = '/\n\s*[\*|\-](.*)/';
$content = preg_replace_callback($regex, function($regs) {
$item = $regs[1];
return sprintf ('