如何在单独的选项卡中打开 bot 框架中的链接

How to open links in bot framework in a seperate tab

机器人框架中是否有配置可以在单独的选项卡中打开 links?

查看 this link,似乎无法在 markdown 中指定在新的 window 中打开 link 并且可以使用 html.

我们不想在每个 link 中指定那个长的 HTML 配置,并且我们不能调用执行该操作的函数,因为某些 link 会作为提示出现它只需要 const(所以调用函数是不可能的)。

因此,我们正在 bot frameowrk 中寻找一些通用配置,使 links 出现在新的 window 中。

机器人框架中有一个名为 CardAction 的 class。

如果你想打开一些 link,你应该有这样的东西:

List<CardAction> listButtons = new List<CardAction>();
listButtons.Add(new CardAction
{
  Value = "https://google.com",
  Type = "openUrl",
  Title = "open google",
});

默认情况下,链接应在新选项卡中打开。此处有一个 GitHub 问题跟踪此问题:https://github.com/Microsoft/BotFramework-WebChat/issues/454

这是修复问题的 PullRequest:configure MarkdownIt to open links in new tab