@@ -12,21 +12,6 @@ import useCopyClipboard from '@/rest/components/useClipboard'
1212import { EventType } from '@/events/types'
1313import { sendEvent } from '@/events/components/events'
1414
15- // Create a unique identifier by sampling characters distributed across content
16- function getBlockId ( text : string , targetLength : number = 8 ) {
17- const alphanumeric = text . replace ( / [ ^ a - z A - Z 0 - 9 ] + / g, '' ) . toLowerCase ( )
18- if ( ! alphanumeric || alphanumeric . length <= targetLength ) {
19- return Math . random ( ) . toString ( 36 ) . substring ( 2 , 10 )
20- }
21- const step = alphanumeric . length / targetLength
22- let result = ''
23- for ( let i = 0 ; i < targetLength ; i ++ ) {
24- const index = Math . floor ( i * step )
25- result += alphanumeric [ index ]
26- }
27- return result
28- }
29-
3015export type MarkdownContentPropsT = {
3116 children : string
3217 className ?: string
@@ -44,7 +29,7 @@ export const UnrenderedMarkdownContent = ({
4429 className,
4530 openLinksInNewTab = true ,
4631 includeQueryParams = true ,
47- codeBlocksCopyable = true ,
32+ codeBlocksCopyable = false ,
4833 eventGroupKey = '' ,
4934 eventGroupId = '' ,
5035 ...restProps
@@ -80,9 +65,10 @@ export const UnrenderedMarkdownContent = ({
8065 if ( isCopied ) {
8166 return t ( 'search.ai.response.copied_code' )
8267 }
83- return t ( 'search.ai.response.copy_code_lang' )
84- . replace ( '{language}' , language ? `${ language } ` : '' )
85- . replace ( '{block}' , getBlockId ( text ) )
68+ return t ( 'search.ai.response.copy_code_lang' ) . replace (
69+ '{language}' ,
70+ language ? `${ language } ` : '' ,
71+ )
8672 }
8773
8874 return (
0 commit comments