File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1919 ],
2020 "require" : {
2121 "php" : " ^7.2|^8.0" ,
22- "torchlight/torchlight-laravel" : " ^0.5.5 " ,
22+ "torchlight/torchlight-laravel" : " ^0.5.9 " ,
2323 "league/commonmark" : " ^1.5|^2.0"
2424 },
2525 "require-dev" : {
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ public function useCustomBlockRenderer($callback)
6666 public function defaultBlockRenderer ()
6767 {
6868 return function (Block $ block ) {
69- return "<pre><code class=' {$ block ->classes }' style=' {$ block ->styles }'> {$ block ->highlighted }</code></pre> " ;
69+ return "<pre><code { $ block -> attrsAsString ()} class=' {$ block ->classes }' style=' {$ block ->styles }'> {$ block ->highlighted }</code></pre> " ;
7070 };
7171 }
7272
Original file line number Diff line number Diff line change @@ -52,6 +52,9 @@ public function it_highlights_code_blocks()
5252 'id ' => 'block_id_1 ' ,
5353 'classes ' => 'torchlight ' ,
5454 'styles ' => 'color: red; ' ,
55+ 'attrs ' => [
56+ 'data-lang ' => 'lang '
57+ ],
5558 'highlighted ' => 'highlighted ' ,
5659 ]]
5760 ];
@@ -64,7 +67,7 @@ public function it_highlights_code_blocks()
6467
6568 $ expected = <<<EOT
6669<p>before</p>
67- <pre><code class='torchlight' style='color: red;'>highlighted</code></pre>
70+ <pre><code data-lang="lang" class='torchlight' style='color: red;'>highlighted</code></pre>
6871<p>after</p>
6972
7073EOT ;
You can’t perform that action at this time.
0 commit comments