Skip to content

Commit

Permalink
Update DynamicMarkdownLinkProcessor.php
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Jul 25, 2024
1 parent 38fc30d commit 9d4fb2d
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,20 @@

use Hyde\Hyde;
use Illuminate\Support\Str;
use Hyde\Support\Facades\Render;
use Hyde\Support\Filesystem\MediaFile;
use Hyde\Markdown\Contracts\MarkdownPostProcessorContract;

class DynamicMarkdownLinkProcessor implements MarkdownPostProcessorContract
{
public static function postprocess(string $html): string
{
if (! Render::getFacadeRoot()) {
// If we're not rendering a page, we can't reliably resolve routes or assets

return $html;
}

foreach (static::routeMap() as $sourcePath => $route) {
$patterns = [
sprintf('<a href="%s">', $sourcePath),
Expand Down

0 comments on commit 9d4fb2d

Please sign in to comment.