Allow articles to be uploaded from a .md file

This commit is contained in:
Jonny Barnes 2017-03-24 13:32:00 +00:00
parent e8965c7a1b
commit 8cf3d05543
4 changed files with 6 additions and 6 deletions

View file

@ -53,10 +53,10 @@ class Article extends Model
*
* @return string
*/
public function getMainAttribute($value)
public function getHtmlAttribute()
{
$markdown = new CommonMarkConverter();
$html = $markdown->convertToHtml($value);
$html = $markdown->convertToHtml($this->main);
//change <pre><code>[lang] ~> <pre><code data-language="lang">
$match = '/<pre><code>\[(.*)\]\n/';
$replace = '<pre><code class="language-$1">';