Replace abandoned spatie/commonmark-highlighter with tempest/highlight
Swap the syntax highlighting library and its CSS theme (zenburn -> nord, matching tempest's class names), add padding to code blocks, and commit the missing compressed winter.js assets from the earlier asset rename. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
f7e13976e0
commit
c420e19f08
19 changed files with 167 additions and 233 deletions
|
|
@ -14,11 +14,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use League\CommonMark\Environment\Environment;
|
||||
use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
|
||||
use League\CommonMark\Extension\CommonMark\Node\Block\FencedCode;
|
||||
use League\CommonMark\Extension\CommonMark\Node\Block\IndentedCode;
|
||||
use League\CommonMark\MarkdownConverter;
|
||||
use Spatie\CommonMarkHighlighter\FencedCodeRenderer;
|
||||
use Spatie\CommonMarkHighlighter\IndentedCodeRenderer;
|
||||
use Tempest\Highlight\CommonMark\HighlightExtension;
|
||||
|
||||
#[Table('articles')]
|
||||
#[Fillable(['url', 'title', 'main', 'published'])]
|
||||
|
|
@ -53,8 +50,7 @@ class Article extends Model
|
|||
get: function () {
|
||||
$environment = new Environment;
|
||||
$environment->addExtension(new CommonMarkCoreExtension);
|
||||
$environment->addRenderer(FencedCode::class, new FencedCodeRenderer);
|
||||
$environment->addRenderer(IndentedCode::class, new IndentedCodeRenderer);
|
||||
$environment->addExtension(new HighlightExtension);
|
||||
$markdownConverter = new MarkdownConverter($environment);
|
||||
|
||||
return $markdownConverter->convert($this->main)->getContent();
|
||||
|
|
|
|||
Loading…
Reference in a new issue