mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-19 18:45:15 +02:00
feat: add search filtering for SurfSense docs mentions and handle zero-width spaces in citations
This commit is contained in:
parent
982dac47ec
commit
c579d773a9
3 changed files with 12 additions and 6 deletions
|
|
@ -16,8 +16,8 @@ import { TooltipIconButton } from "@/components/assistant-ui/tooltip-icon-button
|
|||
import { cn } from "@/lib/utils";
|
||||
|
||||
// Citation pattern: [citation:CHUNK_ID] or [citation:doc-CHUNK_ID]
|
||||
// Also matches Chinese brackets 【】 as LLM sometimes uses them
|
||||
const CITATION_REGEX = /[\[【]citation:(doc-)?(\d+)[\]】]/g;
|
||||
// Also matches Chinese brackets 【】 and handles zero-width spaces that LLM sometimes inserts
|
||||
const CITATION_REGEX = /[\[【]\u200B?citation:(doc-)?(\d+)\u200B?[\]】]/g;
|
||||
|
||||
// Track chunk IDs to citation numbers mapping for consistent numbering
|
||||
// This map is reset when a new message starts rendering
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue