Implement custom parsers/renderers with autowiring for snip content

This commit is contained in:
Tim
2025-04-23 01:06:21 +02:00
parent 5cec259469
commit 943177bc08
15 changed files with 194 additions and 26 deletions

View File

@ -0,0 +1,18 @@
<?php
namespace App\Service\SnipParser\Website;
use App\Service\SnipParser\AbstractParser;
class HtmlParser extends AbstractParser
{
public static function getName(): string
{
return 'html';
}
public function parseView(string $content): string
{
return sprintf('<pre><code class="hljs">%s</code></pre>', htmlspecialchars($content));
}
}