diff --git a/packages/framework/src/Support/Includes.php b/packages/framework/src/Support/Includes.php index e2517e927f3..75a039f7b35 100644 --- a/packages/framework/src/Support/Includes.php +++ b/packages/framework/src/Support/Includes.php @@ -69,10 +69,10 @@ public static function html(string $filename, ?string $default = null): ?HtmlStr $path = static::normalizePath($filename, '.html'); if (! Filesystem::exists($path)) { - return $default === null ? null : new HtmlString($default); + return $default === null ? null : static::renderHtml($default); } - return new HtmlString(Filesystem::get($path)); + return static::renderHtml(Filesystem::get($path)); } /** @@ -116,6 +116,11 @@ protected static function normalizePath(string $filename, string $extension): st return static::path(basename($filename, $extension).$extension); } + protected static function renderHtml(string $html): HtmlString + { + return new HtmlString($html); + } + protected static function renderMarkdown(string $markdown): HtmlString { return new HtmlString(trim(Markdown::render($markdown, MarkdownDocument::class)));