<template>
  <span>{{ removeHtmlTags(content) }}</span>
</template>

<script setup lang="ts">
const props = defineProps({	
  content: {
    type: String,
    default: '',
  },
})

function removeHtmlTags(str: string) {
  str = str.replace(/<[^>]*>/g, '');
  str = str.replace(/&nbsp;/gi, ' '); // 替换为普通空格
  str = str.replace(/&amp;/gi, '&');  // 替换为 &
  str = str.replace(/&lt;/gi, '<');  // 替换为 <
  str = str.replace(/&gt;/gi, '>');  // 替换为 >
  str = str.replace(/&quot;/gi, '"'); // 替换为 "
  str = str.replace(/&#39;/gi, "'");  // 替换为 '
  return str;
}

</script>