File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
webview-ui/src/components/history Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -13,16 +13,17 @@ export const CopyButton = ({ itemTask }: CopyButtonProps) => {
1313 const { isCopied, copy } = useClipboard ( )
1414 const { t } = useAppTranslation ( )
1515
16- const onCopy = useCallback (
17- ( e : React . MouseEvent ) => {
18- e . stopPropagation ( )
19- const tempDiv = document . createElement ( "div" )
20- tempDiv . innerHTML = itemTask
21- const text = tempDiv . textContent || tempDiv . innerText || ""
22- ! isCopied && copy ( text )
23- } ,
24- [ isCopied , copy , itemTask ] ,
25- )
16+ const onCopy = useCallback (
17+ ( e : React . MouseEvent ) => {
18+ e . stopPropagation ( )
19+ const withoutHighlights = itemTask . replace (
20+ / < s p a n c l a s s = " h i s t o r y - i t e m - h i g h l i g h t " > ( .* ?) < \/ s p a n > / g,
21+ "$1" ,
22+ )
23+ ! isCopied && copy ( withoutHighlights )
24+ } ,
25+ [ isCopied , copy , itemTask ] ,
26+ )
2627
2728 return (
2829 < Button
You can’t perform that action at this time.
0 commit comments