-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbootstrap.php
35 lines (31 loc) · 931 Bytes
/
bootstrap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
use TightenCo\Jigsaw\Jigsaw;
/** @var \Illuminate\Container\Container $container */
/** @var \TightenCo\Jigsaw\Events\EventBus $events */
/*
* You can run custom code at different stages of the build process by
* listening to the 'beforeBuild', 'afterCollections', and 'afterBuild' events.
*
* For example:
*
* $events->beforeBuild(function (Jigsaw $jigsaw) {
* // Your code here
* });
*/
$highlighter = new \Tempest\Highlight\Highlighter;
$container['markdownParser']->code_block_content_func = function ($code, $language) use ($highlighter) {
return strtr($highlighter->parse(
content: strtr($code, [
"<{{'?php'}}" => '<?php',
"{{'@'}}" => '@',
'@{{' => '{{',
'@{!!' => '{!!',
]),
language: $language,
), [
'<?php' => "<{{'?php'}}",
'@' => "{{'@'}}",
'{{' => '@{{',
'{!!' => '@{!!',
]);
};