Skip to content

Commit

Permalink
fix: try to escape the string
Browse files Browse the repository at this point in the history
  • Loading branch information
greenhat616 committed Sep 6, 2024
1 parent 9b79b58 commit 9afb912
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/tauri/src/enhance/script/js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,10 @@ impl Runner for JSRunner {
.map_err(|e| { std::io::Error::new(std::io::ErrorKind::InvalidData, e) }),
take_logs(logs)
);
let config = simd_json::to_string(&config).unwrap(); // escape the string
let execute_module = format!(
r#"import process from "./{hash}.mjs";
let config = JSON.parse(`{config}`);
let config = JSON.parse({config});
export let result = JSON.stringify(await process(config));
"#
);
Expand Down

0 comments on commit 9afb912

Please sign in to comment.