, lang?: string} $input * @return array{body: list>} * * @throws AuthorizationException */ public function preview(array $input, string $userUid, string $defaultLang): array { $channels = array_values(array_unique($input['channels'] ?? [])); foreach ($channels as $channel) { $this->channels->assertReadable($channel, $userUid); } $body = $this->markup->render($input['content'], new RenderOptions( channels: $channels, contentType: $input['content_type'] ?? 'markdown', lang: $input['lang'] ?? $defaultLang, )); return ['body' => is_array($body) ? $body : []]; } }