Skip to content

Commit 8db2409

Browse files
author
Jimmycai
committed
fix: HTML tags in message are removed when clicking the copy button in HistoryView.
1 parent 84c6f44 commit 8db2409

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

webview-ui/src/components/history/CopyButton.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@ export const CopyButton = ({ itemTask }: CopyButtonProps) => {
1616
const onCopy = useCallback(
1717
(e: React.MouseEvent) => {
1818
e.stopPropagation()
19-
const tempDiv = document.createElement("div")
20-
tempDiv.innerHTML = itemTask
21-
const text = tempDiv.textContent || tempDiv.innerText || ""
2219

2320
if (!isCopied) {
24-
copy(text)
21+
copy(itemTask)
2522
}
2623
},
2724
[isCopied, copy, itemTask],

0 commit comments

Comments
 (0)