File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 22
22
"doctrine/inflector" : " ^2.0" ,
23
23
"dragonmantank/cron-expression" : " ^3.1" ,
24
24
"egulias/email-validator" : " ^3.1" ,
25
- "league/commonmark" : " ^1.3|^ 2.0" ,
25
+ "league/commonmark" : " ^2.0" ,
26
26
"league/flysystem" : " ^2.0" ,
27
27
"monolog/monolog" : " ^2.0" ,
28
28
"nesbot/carbon" : " ^2.31" ,
Original file line number Diff line number Diff line change 5
5
use Illuminate \Contracts \View \Factory as ViewFactory ;
6
6
use Illuminate \Support \HtmlString ;
7
7
use Illuminate \Support \Str ;
8
- use League \CommonMark \CommonMarkConverter ;
8
+ use League \CommonMark \Environment \Environment ;
9
+ use League \CommonMark \Extension \CommonMark \CommonMarkCoreExtension ;
9
10
use League \CommonMark \Extension \Table \TableExtension ;
11
+ use League \CommonMark \MarkdownConverter ;
10
12
use TijsVerkoyen \CssToInlineStyles \CssToInlineStyles ;
11
13
12
14
class Markdown
@@ -103,11 +105,14 @@ public function renderText($view, array $data = [])
103
105
*/
104
106
public static function parse ($ text )
105
107
{
106
- $ converter = new CommonMarkConverter ([
108
+ $ environment = new Environment ([
107
109
'allow_unsafe_links ' => false ,
108
110
]);
109
111
110
- $ converter ->getEnvironment ()->addExtension (new TableExtension ());
112
+ $ environment ->addExtension (new CommonMarkCoreExtension );
113
+ $ environment ->addExtension (new TableExtension );
114
+
115
+ $ converter = new MarkdownConverter ($ environment );
111
116
112
117
return new HtmlString ((string ) $ converter ->convertToHtml ($ text ));
113
118
}
You can’t perform that action at this time.
0 commit comments