Skip to content

Commit

Permalink
fix: nbsp in editor
Browse files Browse the repository at this point in the history
  • Loading branch information
winchesHe committed Dec 27, 2024
1 parent f11aebe commit b035d63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/hooks/use-clipboard/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export function useClipboard({timeout = 2000}: UseClipboardProps = {}) {
);

const transformWhitespace = useCallback((text: string) => {
// Manually replace all whitespace to avoid get different unicode characters;
return text.replace(/\s/g, " ");
// Manually replace all   to avoid get different unicode characters;
return text.replace(/[\u00A0]/g, " ");
}, []);

const copy = useCallback(
Expand Down

0 comments on commit b035d63

Please sign in to comment.