diff --git a/app/Article.php b/app/Article.php index 3ff391bc..84324892 100644 --- a/app/Article.php +++ b/app/Article.php @@ -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
[lang] ~>
$match = '/\[(.*)\]\n/';
$replace = '';
diff --git a/resources/views/admin/welcome.blade.php b/resources/views/admin/welcome.blade.php
index d77ca425..72a38221 100644
--- a/resources/views/admin/welcome.blade.php
+++ b/resources/views/admin/welcome.blade.php
@@ -8,7 +8,7 @@ Admin CP
Hello {{ $name }}!
Articles
-You can either create new blog posts, or edit them.
+
You can either create new blog posts, or edit them.
Notes
You can either create new notes, or edit them.
diff --git a/resources/views/articles/index.blade.php b/resources/views/articles/index.blade.php
index 19b57894..f391345e 100644
--- a/resources/views/articles/index.blade.php
+++ b/resources/views/articles/index.blade.php
@@ -23,7 +23,7 @@ Articles «
Posted - ⚓
- {!! $article['main'] !!}
+ {!! $article->html !!}
@endforeach
diff --git a/resources/views/articles/show.blade.php b/resources/views/articles/show.blade.php
index ad39068f..0dea199a 100644
--- a/resources/views/articles/show.blade.php
+++ b/resources/views/articles/show.blade.php
@@ -1,7 +1,7 @@
@extends('master')
@section('title')
-{{ strip_tags($article->title) }} «
+{{ strip_tags($article->title) }} «
@stop
@section('content')
@@ -13,7 +13,7 @@
Posted - ⚓
-{!! $article->main !!}
+{!! $article->html !!}
@stop