fixes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user