This commit is contained in:
Doar Mihai
2026-04-04 18:19:34 +03:00
parent 5fb17f717d
commit 7c09846bd6
22 changed files with 1229 additions and 94 deletions
@@ -46,9 +46,16 @@ class AdzunaTransformer implements JobTransformer
private function sanitizeDescription(string $description): string
{
$clean = strip_tags($description);
// Adzuna returns truncated descriptions with ellipsis (...)
// Keep the description as-is but strip excessive HTML while preserving basic formatting
$clean = strip_tags($description, '<p><br><ul><ol><li><strong><b><em><i><h1><h2><h3><h4>');
$clean = html_entity_decode($clean, ENT_QUOTES | ENT_HTML5, 'UTF-8');
$clean = preg_replace('/\s+/', ' ', $clean);
// Convert multiple spaces to single space but preserve newlines
$clean = preg_replace('/[^\S\n]+/', ' ', $clean);
// Note: Adzuna API only provides truncated descriptions in search results.
// Full descriptions would require individual job detail API calls.
return trim($clean);
}