Skip to content

Commit

Permalink
Fix SetClipboardText for web
Browse files Browse the repository at this point in the history
  • Loading branch information
ubkp committed Aug 19, 2023
1 parent 016b7d0 commit 54ff652
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -2148,7 +2148,7 @@ void SetClipboardText(const char *text)
#if defined(PLATFORM_WEB)
// Security check to (partially) avoid malicious code
if (strchr(text, '\'') != NULL) TRACELOG(LOG_WARNING, "SYSTEM: Provided Clipboard could be potentially malicious, avoid [\'] character");
else emscripten_run_script(TextFormat("navigator.clipboard.writeText('%s')", text));
else emscripten_run_script(TextFormat("navigator.clipboard.writeText(`%s`)", text));
#endif
}

Expand Down

0 comments on commit 54ff652

Please sign in to comment.