-
Notifications
You must be signed in to change notification settings - Fork 91
Open
Description
Example
$ cat ./webR-message-newline.mjs
#! /usr/bin/env node
import { WebR } from "webr";
import WebSocket from "ws";
console.log('Node.js v', process.version);
// Launch webR instance
const webR = new WebR();
await webR.init();
console.log("webR v" + webR.version);
const code = `
cat("----------------------\n")
cat("abc")
cat("def")
cat("\n")
cat("ABC\n")
cat("DEF\n")
cat("----------------------\n")
message("abc", appendLF = FALSE)
message("def", appendLF = FALSE)
message("ABC\n", appendLF = FALSE)
message("DEF\n", appendLF = FALSE)
cat("----------------------\n")
message("abc", appendLF = TRUE)
message("def", appendLF = TRUE)
message("ABC\n", appendLF = TRUE)
message("DEF\n", appendLF = TRUE)
cat("----------------------\n")
`;
await webR.evalR(code);
process.exit(0);gives
$ ./webR-message-newline.mjs
Node.js v v22.19.0
webR v0.5.6
----------------------
abcdef
ABC
DEF
----------------------
abc
def
ABC
DEF
----------------------
abc
def
ABC
DEF
----------------------but I'd expect:
----------------------
abcdef
ABC
DEF
----------------------
abcdefABC
DEF
----------------------
abc
def
ABC
DEF
----------------------
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels