[面临的问题]
如果我在输入“后立即输入”空白“
(换行)”在正文中,“空白”变成两个。
[脚本]
function sendEmail() {
MailApp.sendEmail({
to: "test@example.com",
subject: "Test",
body: "───────────────\n Hello, world!", //<-1 blank
});
}
[结果]
────────────────
你好世界! <-2 blanks at the beginning
[我尝试过的]
function sendEmail() {
MailApp.sendEmail({
to: "test@example.com",
subject: "Test",
body: "───────────────\n Hello, world!",
});
}
[结果]
────────────────
你好世界! <-displayed as is
[想要达到的目标]
我要一张空白显示器。
您可以尝试使用 Unicode 转义序列 以及 unicode 中所需的 空白字符(例如,
200A
(头发空间)或 2009
(薄空间)):
body: "───────────────\n\u{00A0}Hello, world!"