summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorubkp <[email protected]>2023-08-26 09:40:30 -0300
committerGitHub <[email protected]>2023-08-26 14:40:30 +0200
commit4fa66f26359ba21068db15b1268cf7fb03422afa (patch)
treeb9b9d8bcc4aeed220e4a81a23c791d40cb3cda85
parent8f228626a2cdeb0749818b235f06b94e804bd873 (diff)
downloadraylib-4fa66f26359ba21068db15b1268cf7fb03422afa.tar.gz
raylib-4fa66f26359ba21068db15b1268cf7fb03422afa.zip
Fix SetClipboardText for web (#3257)
-rw-r--r--src/rcore.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rcore.c b/src/rcore.c
index 10303fe9..8413df2a 100644
--- a/src/rcore.c
+++ b/src/rcore.c
@@ -2150,7 +2150,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 EM_ASM( { navigator.clipboard.writeText(UTF8ToString($0)); }, text);
#endif
}