Allow articles to be uploaded from a .md file
This commit is contained in:
parent
e8965c7a1b
commit
8cf3d05543
4 changed files with 6 additions and 6 deletions
|
@ -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">';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue