@@ -12,21 +12,6 @@ import useCopyClipboard from '@/rest/components/useClipboard'
12
12
import { EventType } from '@/events/types'
13
13
import { sendEvent } from '@/events/components/events'
14
14
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
-
30
15
export type MarkdownContentPropsT = {
31
16
children : string
32
17
className ?: string
@@ -44,7 +29,7 @@ export const UnrenderedMarkdownContent = ({
44
29
className,
45
30
openLinksInNewTab = true ,
46
31
includeQueryParams = true ,
47
- codeBlocksCopyable = true ,
32
+ codeBlocksCopyable = false ,
48
33
eventGroupKey = '' ,
49
34
eventGroupId = '' ,
50
35
...restProps
@@ -80,9 +65,10 @@ export const UnrenderedMarkdownContent = ({
80
65
if ( isCopied ) {
81
66
return t ( 'search.ai.response.copied_code' )
82
67
}
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
+ )
86
72
}
87
73
88
74
return (
0 commit comments