Zeige formatierte Texte überall als Klartext, wo kein HTML hingehört
Deploy Test / test (push) Successful in 4m27s
Deploy Test / deploy (push) Successful in 40s

Öffentliche Leser, Shop, Medienliste und Bibliothek lesen Kurzbeschreibung,
Beschreibung und Lernziel als Klartext; Mitgliederseiten zu Programm, Inhalt und
Artikel zeigen die formatierte Fassung. Der Editor trägt die deutsche Bezeichnung
des Felds als Namen für Hilfstechnik, der Tastaturfokus landet im Editor, und der
Abgleich merkt sich nur eine Prüfsumme. ADR-50 nennt Rückfall und Suche.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-24 00:01:53 +01:00
1 parent 9fbd933e1e
commit 99122ddfee
14 files changed
+85 -33

No files matched your search

@@ -4,11 +4,13 @@
use App\Domain\Catalog\CompositionKind;
use App\Domain\Catalog\ContentService;
use App\Domain\Catalog\EditorialProfileReader;
use App\Domain\Catalog\FormattedText;
use App\Domain\Catalog\IdentityChange;
use App\Filament\Resources\ContentElements\Pages\ViewContentElement;
use App\Filament\Resources\Practices\Pages\EditPractice;
use App\Filament\Support\EditorialCatalog;
use App\Http\LibraryCatalog;
use App\Models\User;
use Filament\Facades\Filament;
use Illuminate\Foundation\Testing\RefreshDatabase;
@@ -99,6 +101,29 @@ public function test_a_list_and_a_nested_list_pass_the_payload_depth_guard(): vo
$this->assertStringContainsString('Geändert', $component->get('summary'));
}
public function test_a_formatted_summary_reads_as_plain_text_wherever_a_card_or_list_uses_it(): void
{
$practice = app(EditorialCatalog::class)->create('Stopp sagen', CompositionKind::Exercise);
$practice->forceFill([
'summary' => '<p>Kurz <strong>fett</strong> &amp; klar</p><ul><li><p>Eins</p></li><li><p>Zwei</p></li></ul>',
'description' => '<p>Lang <em>erklärt</em></p>',
])->save();
$text = app(LibraryCatalog::class)->text($practice->fresh());
$this->assertSame('Kurz fett & klar
- Eins
- Zwei', $text['summary']);
$this->assertSame('Lang erklärt', $text['description']);
$this->assertStringContainsString('<strong>fett</strong>', $text['summary_html']);
$this->assertStringContainsString('<em>erklärt</em>', $text['description_html']);
$profile = app(EditorialProfileReader::class)->read($practice->fresh(), 'bibliothek');
$this->assertStringNotContainsString('<', (string) $profile->value('summary'));
$this->assertStringContainsString('<ul>', $profile->html('summary'));
}
public function test_opening_a_legacy_exercise_reports_no_unsaved_changes(): void
{
$exercise = $this->exercise('Altbestand');