diff --git a/apps/admin-web/src/views/TrackingQuestionDetailView.vue b/apps/admin-web/src/views/TrackingQuestionDetailView.vue index 4252a67..23fb746 100644 --- a/apps/admin-web/src/views/TrackingQuestionDetailView.vue +++ b/apps/admin-web/src/views/TrackingQuestionDetailView.vue @@ -647,6 +647,35 @@ function shouldStripDeepSeekOrphanAnchor(anchor: HTMLAnchorElement): boolean { ) } +function isDeepSeekLinkIconSvg(svg: SVGElement): boolean { + const viewBox = svg.getAttribute('viewBox')?.trim() ?? '' + const width = svg.getAttribute('width')?.trim() ?? '' + const height = svg.getAttribute('height')?.trim() ?? '' + const paths = Array.from(svg.querySelectorAll('path')) + return ( + viewBox === '0 0 14 14' && + width === '14' && + height === '14' && + paths.length === 2 && + paths.every((path) => path.getAttribute('fill') === 'currentColor') + ) +} + +function stripDeepSeekLinkIconNodes(root: HTMLElement): void { + for (const svg of Array.from(root.querySelectorAll('svg'))) { + if (!isDeepSeekLinkIconSvg(svg)) { + continue + } + const parent = svg.parentElement + const parentText = parent?.textContent?.trim() ?? '' + if (parent && parent !== root && parent.children.length === 1 && parentText === '') { + parent.remove() + continue + } + svg.remove() + } +} + function collectDeepSeekCitationReferenceLabels( platform: MonitoringQuestionDetailPlatform | null, ): string[][] { @@ -970,6 +999,8 @@ function renderDeepSeekAnswerContent( const fallbackLabels = new Map() const fallbackState = { nextIndex: 1 } + stripDeepSeekLinkIconNodes(root) + for (const anchor of Array.from(root.querySelectorAll('a[href], a'))) { const rawHref = anchor.hasAttribute('href') ? anchor.getAttribute('href') || anchor.href || ''