Merge remote-tracking branch 'origin/develop' into feature/videoplayer-grundlagen
This commit is contained in:
commit
ec8c173053
6 files changed
+49
-1
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user