【发布时间】:2021-08-16 11:14:50
【问题描述】:
我正在尝试将 html 字符串呈现到基于 Azure 通信服务的聊天应用程序中。样板代码取自 Azure Samples GitHub repo https://github.com/Azure-Samples/communication-services-web-chat-hero。
我有以下格式的字符串:
"str1</br>str2</br>str3</br>".
我想要在应用程序的 ChatArea 组件中将此字符串呈现为 html,使其看起来像
str1
str2
str3
我还在 sideEffects.ts 文件中的 sendMessageHelper 方法中将 SendMessageOptions.type 设置为“html”,但仍将输出仅作为字符串获取。唯一的区别是现在我在br 标签中得到了没有/ 的净化字符串。
任何帮助将不胜感激。 提前非常感谢。
【问题讨论】:
标签: azure-communication-services