Skip to content

Commit

Permalink
fix: 复制时移除空控制符 (antvis#2204)
Browse files Browse the repository at this point in the history
fix: 移除空控制符

Co-authored-by: 沫君 <[email protected]>
  • Loading branch information
lcx-seima and 沫君 authored May 11, 2023
1 parent 1734416 commit ce9dcab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/s2-core/src/utils/export/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ export const copyToClipboardByClipboard = (data: Copyable): Promise<void> => {
new ClipboardItem(
[].concat(data).reduce((prev, copyable: CopyableItem) => {
const { type, content } = copyable;
// eslint-disable-next-line no-control-regex
const contentToCopy = content.replace(/\x00/g, '');
return {
...prev,
[type]: new Blob([content], { type }),
[type]: new Blob([contentToCopy], { type }),
};
}, {}),
),
Expand Down

0 comments on commit ce9dcab

Please sign in to comment.