liujie
2026-09-17 c867f2b648ce3dfb5a679ca86bb38f228317fc3b
mingdaojingjiang_uniapp/mingdaojingjiang_uniapp/pages/agreement-detail/index.vue
@@ -111,7 +111,12 @@
  try {
    return htmlParser(html)
  } catch (error) {
    return [{ type: 'text', text: content || '' }]
    // 兜底只保留可读文本,避免把 HTML 源码直接展示给用户
    const plainText = (content || '')
      .replace(/<style[\s\S]*?<\/style>/gi, '')
      .replace(/<[^>]+>/g, '')
      .replace(/&nbsp;/g, ' ')
    return [{ type: 'text', text: plainText }]
  }
})