mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-08 20:25:19 +02:00
fix: support Chinese brackets in citation regex
This commit is contained in:
parent
5e31a228bc
commit
982dac47ec
1 changed files with 2 additions and 1 deletions
|
|
@ -16,7 +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]
|
||||
const CITATION_REGEX = /\[citation:(doc-)?(\d+)\]/g;
|
||||
// Also matches Chinese brackets 【】 as LLM sometimes uses them
|
||||
const CITATION_REGEX = /[\[【]citation:(doc-)?(\d+)[\]】]/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