Allow heading tags (h1-h6) in ContentSanitizer so news editor headings render
This commit is contained in:
24
app/Support/ArtworkDescriptionContentValidator.php
Normal file
24
app/Support/ArtworkDescriptionContentValidator.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Support;
|
||||
|
||||
use App\Services\ContentSanitizer;
|
||||
|
||||
final class ArtworkDescriptionContentValidator
|
||||
{
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
public static function errors(null|string $value): array
|
||||
{
|
||||
$normalized = trim((string) ($value ?? ''));
|
||||
|
||||
if ($normalized === '') {
|
||||
return [];
|
||||
}
|
||||
|
||||
return ContentSanitizer::validate($normalized);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user