diff --git a/roman.php b/roman.php index 1e9f934..bd0e699 100644 --- a/roman.php +++ b/roman.php @@ -20,9 +20,18 @@ if (!$story) { function deltaToHtml($content) { if (empty($content)) return ''; - // Si le contenu est déjà en HTML (ancien format) + // Si le contenu est déjà en HTML if (is_string($content) && !isJson($content)) { - return $content; + // Nettoyer les URLs des images dans le HTML + return preg_replace_callback( + '/]+src=([\'"])((?:\.\.\/)*(?:assets\/[^"\']+))\1[^>]*>/', + function($matches) { + // $matches[2] contient l'URL + $cleanUrl = preg_replace('/^(?:\.\.\/)+/', '', $matches[2]); + return str_replace($matches[2], $cleanUrl, $matches[0]); + }, + $content + ); } // Convertir la chaîne JSON en tableau si nécessaire