改变单元格的文本格式会破坏谷歌工作表中的超链接



我正在创建一个谷歌工作表,添加内容,如:=HYPERLINK("https://example.com","Example")

在我尝试更改单元格之前,它运行良好->userEnteredFormat->text格式化

以下是断开链接的示例

单元格格式有效(请参阅第二页(。

如果我从更改配置

"cell" => [
"userEnteredFormat" => [
"backgroundColor" => [
"red" => 1.0,
"green" => 1.0,
"blue" => 1.0
],
"horizontalAlignment" => "LEFT",
"wrapStrategy" => "WRAP",
"textFormat" => [
"foregroundColor" => [
"red" => 0.0,
"green" => 0.0,
"blue" => 0.5
],
"fontSize" => 10,
"bold" => true
]
]
],
"fields" => "userEnteredFormat(backgroundColor,textFormat,horizontalAlignment,wrapStrategy)"

"cell" => [
"userEnteredFormat" => [
"backgroundColor" => [
"red" => 1.0,
"green" => 1.0,
"blue" => 1.0
],
"horizontalAlignment" => "LEFT",
"wrapStrategy" => "WRAP",
"textFormat" => [
]
]
],
"fields" => "userEnteredFormat(backgroundColor,textFormat,horizontalAlignment,wrapStrategy)"

这个问题消失了。

我认为从您的请求主体来看,我认为您的问题可能是由于fields。那么,在您的情况下,将fields的值修改如下如何?

发件人:

"fields" => "userEnteredFormat(backgroundColor,textFormat,horizontalAlignment,wrapStrategy)"

收件人:

"fields" => "userEnteredFormat(backgroundColor,textFormat(foregroundColor,fontSize,bold),horizontalAlignment,wrapStrategy)"

参考:

  • 方法:spreadsheets.batchUpdate

最新更新