[英]How can you send an html page with an image from a file via node.js
[英]How do you send HTML formatted messages over XMPP with Node.JS?
這個問題討論了使用 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>
請注意,對於無法呈現 XHTML 的客戶端,還包括純文本。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.