; auf der Website erschienen die Tags als * Text, z. B. in der FAQ (12.10.2026). */ it('stores pasted text from the editor without paragraph tags', function (string $editor, string $stored) { expect(CmsFluxEditorHtmlTransformer::unwrapParagraphs($editor))->toBe($stored); })->with([ 'ein Absatz' => ['
Eingefügter Text
', 'Eingefügter Text'], 'Sonderzeichen' => ['Planung & Montage
', 'Planung & Montage'], 'fett' => ['Mit fett
', 'Mit fett'], 'zwei Absätze' => ['Eins
Zwei
', 'EinsText
Text
', 'Text
'], 'schon Klartext' => ['Ohne Tags', 'Ohne Tags'], ]); it('renders cms text inline: plain text escaped, editor html without paragraphs, nothing unsafe', function (string $value, string $html) { expect((string) cms_inline($value))->toBe($html); })->with([ ['Planung & Montage', 'Planung & Montage'], ['Schon gespeichert
', 'Schon gespeichert'], ['Mit Hervorhebung
', 'Mit Hervorhebung'], ['a
b
', 'a<script>
', ''], ]); it('saves a pasted faq answer without p tags and shows it cleanly on the page', function () { $this->actingAs(User::factory()->create()); $this->seed(CmsContentSeeder::class); $row = CmsContent::query()->where('group', 'faq')->where('key', 'faq')->first(); $component = Volt::test('admin.cms.content-index') ->call('startFieldEdit', $row->id, 'questions'); $component->set('jsonItems.0.answer', 'Neue Antwort aus der Zwischenablage
') ->call('saveJsonModal'); expect($row->refresh()->getTranslation('value', 'de')['questions'][0]['answer'])->toBe('Neue Antwort aus der Zwischenablage'); $page = $this->get('/faq')->assertSuccessful()->getContent(); expect(substr($page, strpos($page, 'id="faq"')))->toContain('Neue Antwort aus der Zwischenablage') ->not->toContain('<p>'); }); it('shows answers that were already stored with p tags without the tags', function () { $this->seed(CmsContentSeeder::class); $row = CmsContent::query()->where('group', 'faq')->where('key', 'faq')->first(); $value = $row->getTranslation('value', 'de'); $value['questions'][0]['answer'] = 'Bereits gespeichert mit Absatz
'; $row->setTranslation('value', 'de', $value)->save(); app(FluxCms\Core\Services\CmsContentService::class)->clearCache('faq'); $page = $this->get('/faq')->assertSuccessful()->getContent(); $section = substr($page, strpos($page, 'id="faq"')); expect($section)->toContain('Bereits gespeichert mit Absatz') ->not->toContain('<p>') ->not->toContain('Bereits'); });