···11<script setup lang="ts">
22+import { decodeHtmlEntities } from '~/utils/formatters'
33+24const props = defineProps<{
35 text: string
46 /** When true, renders link text without the anchor tag (useful when inside another link) */
···21232224// Strip HTML tags and escape remaining HTML to prevent XSS
2325function stripAndEscapeHtml(text: string): string {
2424- // First strip markdown image badges
2525- let stripped = stripMarkdownImages(text)
2626+ // First decode any HTML entities in the input
2727+ let stripped = decodeHtmlEntities(text)
2828+2929+ // Then strip markdown image badges
3030+ stripped = stripMarkdownImages(stripped)
26312732 // Then strip actual HTML tags (keep their text content)
2833 // Only match tags that start with a letter or / (to avoid matching things like "a < b > c")