gpt4 book ai didi

google-apps-script - 如何在 Google Apps jsdoc 描述中强制换行

转载 作者:行者123 更新时间:2023-12-01 20:26:51 27 4
gpt4 key购买 nike

我不知道如何在 Google Apps 脚本中正确显示此内容。我需要它在 jsdoc 输出中显示新行(例如,当函数工具提示窗口出现在电子表格函数中时。)我尝试过像
这样的 html,但它只是呈现为文本而不是换行符。

例如:

/**
* Converts the prefixed value to the specified base.
* Requires one of the following prefixes:
* '0b' Base 2: binary
* '0q' Base 4: quaternary
* '0o' Base 8: octal
* '0x' Base 16: hexadecimal
*
* @param {string} Value The prefixed value to convert.
* @param {number} To The base to convert to.
* @return The converted base.
* @customfunction
*/
function BASEP(Value, To) {

这只会呈现一个文本 block ,例如:

Summary:
Converts the prefixed value to the specified base. Requires
one of the following prefixes: 0b Base 2: binary 0q Base 4:
quaternary 0o Base 8: octal 0x Base 16: hexadecimal

最佳答案

这个方法对我有用。在 markdown (或 StackOverflow)中,您需要有两个换行符(即额外的一个)来开始新行(或段落)。同样的方法适用于 JSDoc

/**
* Converts the prefixed value to the specified base.
*
* Requires one of the following prefixes:
*
* '0b' Base 2: binary<br>
* '0q' Base 4: quaternary
* '0o' Base 8: octal<
* '0x' Base 16: hexadecimal
*
*/
async function test() {
return;
}

证明:

原始案例

original

附加行:

new

ps

  • 在最新的 vscode 上的 Typescript + tslint + prettier 上进行了测试(不知道版本,全部已更新)。
  • 这是 Loopback 4 项目

关于google-apps-script - 如何在 Google Apps jsdoc 描述中强制换行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28245463/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com