Merge remote-tracking branch 'origin/develop' into feature/videoplayer-grundlagen
Deploy Test / test (push) Successful in 7m19s
Deploy Test / deploy (push) Successful in 37s

This commit is contained in:
Stommer committed 2026-12-01 11:20:08 +01:00
commit ec8c173053
6 files changed
+49 -1

No files matched your search

+4 -1
View File
@@ -32,6 +32,9 @@ final class FormattedText
/** Blockelemente, mit denen gespeichertes HTML beginnt. */
private const BLOCKS = ['p', 'h3', 'h4', 'h5', 'h6', 'ul', 'ol', 'blockquote', 'table', 'img'];
/** Zusätzlich zu den Blöcken erkennt der Textanfang h1, h2 und div als HTML; die Bereinigung bildet sie auf h3 und p ab (mapLegacyTags). */
private const START_TAGS = ['h1', 'h2', 'div'];
/** Angaben der Redaktion, die formatiert gespeichert werden. Suchbegriffe, Titel und Teaser bleiben Klartext. */
public const FIELDS = ['summary', 'description'];
@@ -59,7 +62,7 @@ final class FormattedText
/** Wird der Wert als HTML gelesen (sonst als Klartext des Altbestands)? */
public static function isHtml(?string $value): bool
{
return preg_match('/^\s*<(?:'.implode('|', self::BLOCKS).')[\s>\/]/i', (string) $value) === 1;
return preg_match('/^\s*<(?:'.implode('|', [...self::BLOCKS, ...self::START_TAGS]).')[\s>\/]/i', (string) $value) === 1;
}
/**