这个问题讨论使用node-xmpp发送消息: Connecting to Google Talk over XMPP on Node.js
任何人都知道如何获取 HTML 格式的消息。他们使用的库在名为 ltx 的节点模块中转义了 HTML。
请参阅XEP-0071。确保您的 HTML 是有效的 XML ( XHTML ),然后像这样嵌入:
<message>
<body>Wow, I'm green with envy!</body>
<html xmlns='http://jabber.org/protocol/xhtml-im'>
<body xmlns='http://www.w3.org/1999/xhtml'>
<p style='font-size:large'>
<em>Wow</em>, I'm <span style='color:green'>green</span>
with <strong>envy</strong>!
</p>
</body>
</html>
</message>
Run Code Online (Sandbox Code Playgroud)
请注意,对于无法呈现 XHTML 的客户端,也包含纯文本。
| 归档时间: |
|
| 查看次数: |
5754 次 |
| 最近记录: |