@php
$safeQuestionHtml = (string) ($q->question ?? '');
// Strip dangerous tags while keeping rich formatting and tags intact
$safeQuestionHtml = preg_replace('#<(script|style|iframe|object|embed)[^>]*>.*?\1>#is', '', $safeQuestionHtml);
$safeQuestionHtml = preg_replace('/\son[a-z]+\s*=\s*("[^"]*"|\'[^\']*\'|[^\s>]+)/i', '', $safeQuestionHtml);
$safeQuestionHtml = strip_tags($safeQuestionHtml, '
');
$lvl = strtolower($q->level ?? 'medium');
$diffClass = $lvl === 'easy' ? 'st-diff-easy' : ($lvl === 'medium' ? 'st-diff-medium' : 'st-diff-hard');
@endphp
{{ $q->title }}
@if(!empty($isSql))
SQL
@endif
{{ trim($q->t1) }}
{{ $p['in'] }}
@endif
@if(trim((string) $p['out']) !== '')
{{ $p['out'] }}
@endif
{{ trim($q->answer) }}