更改单元格的文本格式会破坏 Google sheet 中的超链接

Altering textFormat of a cell breaks hyperlinks in Google sheet

我正在创建 Google Sheet 添加如下内容:=HYPERLINK("https://example.com","Example")

在我尝试更改单元格 -> userEnteredFormat -> textFormat 之前它工作正常

Here's an example of broken links

单元格格式有效(参见第二个 sheet)。

如果我更改我的配置

                  "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)"

参考: