diff --git a/packages/framework/src/Markdown/Models/Markdown.php b/packages/framework/src/Markdown/Models/Markdown.php index 568ae22be2e..e9c6c80c6a7 100644 --- a/packages/framework/src/Markdown/Models/Markdown.php +++ b/packages/framework/src/Markdown/Models/Markdown.php @@ -5,7 +5,6 @@ namespace Hyde\Markdown\Models; use Hyde\Framework\Services\MarkdownService; -use Hyde\Markdown\MarkdownConverter; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Contracts\Support\Htmlable; use Illuminate\Support\HtmlString; @@ -84,20 +83,13 @@ public static function fromFile(string $path): static /** * Render a Markdown string into HTML. * - * If a source model is provided, the Markdown will be converted using the dynamic MarkdownService, - * otherwise, the pre-configured singleton from the service container will be used instead. + * If a source page class is provided, that class will be used to configure + * the Hyde Markdown converter to enable features specific to that page. * * @return string $html */ public static function render(string $markdown, ?string $pageClass = null): string { - if ($pageClass !== null) { - return (new MarkdownService($markdown, $pageClass))->parse(); - } else { - /** @var MarkdownConverter $converter */ - $converter = app(MarkdownConverter::class); - - return (string) $converter->convert($markdown); - } + return (new MarkdownService($markdown, $pageClass))->parse(); } } diff --git a/packages/framework/tests/Feature/ColoredBlockquoteShortcodesTest.php b/packages/framework/tests/Feature/ColoredBlockquoteShortcodesTest.php index dce752c8313..f12ffed3492 100644 --- a/packages/framework/tests/Feature/ColoredBlockquoteShortcodesTest.php +++ b/packages/framework/tests/Feature/ColoredBlockquoteShortcodesTest.php @@ -12,6 +12,9 @@ */ class ColoredBlockquoteShortcodesTest extends UnitTestCase { + protected static bool $needsKernel = true; + protected static bool $needsConfig = true; + public function testSignature() { $this->assertSame('>', ColoredBlockquotes::signature()); diff --git a/packages/framework/tests/Unit/MarkdownFacadeTest.php b/packages/framework/tests/Unit/MarkdownFacadeTest.php index 88531f35744..88903630f90 100644 --- a/packages/framework/tests/Unit/MarkdownFacadeTest.php +++ b/packages/framework/tests/Unit/MarkdownFacadeTest.php @@ -12,6 +12,9 @@ */ class MarkdownFacadeTest extends UnitTestCase { + protected static bool $needsKernel = true; + protected static bool $needsConfig = true; + public function testRender(): void { $html = Markdown::render('# Hello World!');