Skip to content

Commit faeb7ac

Browse files
committed
Added usage LaravelSu/Highlight extension
1 parent 7b71fb4 commit faeb7ac

File tree

6 files changed

+1011
-648
lines changed

6 files changed

+1011
-648
lines changed

app/Docs.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ public function content(): ?string
132132
->after('---')
133133
->after('---')
134134
->markdown(extensions: [
135+
new \Laravelsu\Highlight\CommonMark\HighlightExtension(),
135136
new UnfencedExtension,
136137
])
137138
->toString();

app/Library.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Illuminate\Support\Facades\Storage;
66
use Illuminate\Support\Str;
7+
use Laravelsu\Highlight\CommonMark\HighlightExtension;
78
use Symfony\Component\Yaml\Yaml;
89

910
class Library
@@ -29,7 +30,9 @@ public function __construct(string $name)
2930
$this->content = Str::of($raw)
3031
->after('---')
3132
->after('---')
32-
->markdown()
33+
->markdown(extensions: [
34+
new HighlightExtension()
35+
])
3336
->toString();
3437
}
3538

app/Models/Comment.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ public function prettyComment(): string
125125
],
126126
],
127127
[
128+
new \Laravelsu\Highlight\CommonMark\HighlightExtension(),
128129
new MentionExtension,
129130
]
130131
);

app/View/Components/Posts/Content.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ public function toHtml(): string
5252
'allow_unsafe_links' => false,
5353
'html_input' => 'escape',
5454
'max_nesting_level' => 20,
55-
])
55+
],
56+
[
57+
new \Laravelsu\Highlight\CommonMark\HighlightExtension(),
58+
])
5659
->toString();
5760

5861
return app(Pipeline::class)

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"cagilo/cagilo": "^3.3",
2424
"esplora/spire": "0.0.3",
2525
"guzzlehttp/guzzle": "^7.2",
26+
"hidehalo/nanoid-php": "^2.0",
2627
"hotwired-laravel/turbo-laravel": "2.0.1",
2728
"intervention/image": "^3.4",
2829
"jolicode/jolitypo": "^1.4",
@@ -35,6 +36,7 @@
3536
"laravel/telescope": "^5.0",
3637
"laravel/tinker": "^2.8",
3738
"laravel/unfenced": "dev-main",
39+
"laravelsu/highlight": "dev-main",
3840
"orchid/platform": "^14.39",
3941
"overtrue/laravel-like": "^5.2",
4042
"spatie/laravel-activitylog": "^4.7",

0 commit comments

Comments
 (0)