{{ $post->excerpt }}
@endif
@php
$content = $post->content;
// Case 1: Replace hardcoded localhost/127.0.0.1 (http and https) with relative paths
// This handles images saved with absolute local URLs when viewing from another device
$content = str_replace(['http://localhost:8000/', 'http://127.0.0.1:8000/'], '/', $content);
$content = str_replace(['https://localhost:8000/', 'https://127.0.0.1:8000/'], '/', $content);
// Case 2: Fix relative storage paths missing leading slash (e.g. src="storage/...")
// We use preg_replace to target src attributes starting specifically with "storage/"
$content = preg_replace('/src=["\'](storage\/[^"\']+)["\']/', 'src="/$1"', $content);
@endphp
{!! $content !!}
@if($post->tags->count() > 0)
Mots-clés
@foreach($post->tags as $tag)
{{ $tag->name }}
@endforeach