@php $safeQuestionHtml = (string) ($q->question ?? ''); // Strip dangerous tags while keeping rich formatting and tags intact $safeQuestionHtml = preg_replace('#<(script|style|iframe|object|embed)[^>]*>.*?#is', '', $safeQuestionHtml); $safeQuestionHtml = preg_replace('/\son[a-z]+\s*=\s*("[^"]*"|\'[^\']*\'|[^\s>]+)/i', '', $safeQuestionHtml); $safeQuestionHtml = strip_tags($safeQuestionHtml, '