Comments (9)
https://xmpp.org/rfcs/rfc6121.html#message-syntax-extended
from ltx.
so something like
reply.c('html', {xmlns: 'http://jabber.org/protocol/xhtml-im'}).c('body', {xmlns: 'http://www.w3.org/1999/xhtml'}).c('a', {href: 'http://www.google.com'}).t('Google')
from ltx.
Maybe we should have something like innerHTML
in ltx, what do you think?
from ltx.
Thanks for your quick response.
After using your suggestion "reply.c('html', {xmlns: 'http://jabber.org/protocol/xhtml-im'}).c('body', {xmlns: 'http://www.w3.org/1999/xhtml'}).c('a', {href: 'http://www.google.com'}).t('Google')"
I received http://www.google.com on the client and not Google
from ltx.
update:
HTML tags in general are working... e.g.
reply.c('html', {xmlns: 'http://jabber.org/protocol/xhtml-im'}).c('body', {xmlns: 'http://www.w3.org/1999/xhtml'}).c('font', {color: 'red'}).t('Google!!!')
However, hyperlink is not. when using anchor element the url gets displayed.
from ltx.
@saurabhm27 can you provide an example?
from ltx.
if (stanza.is('message') && stanza.attrs.type === 'chat' ) {
var reply = new xmpp.Client.Stanza('message', {
to: stanza.attrs.from,
from: stanza.attrs.to,
type: 'chat'
})
// reply.c('html', {xmlns: 'http://jabber.org/protocol/xhtml-im'}).c('body', {xmlns: 'http://www.w3.org/1999/xhtml'}).c('a', {href: 'http://www.google.com'}).t('Google') // the jabber client receives http://www.google.com. The word Google is omitted.
reply.c('html', {xmlns: 'http://jabber.org/protocol/xhtml-im'}).c('body', {xmlns: 'http://www.w3.org/1999/xhtml'}).c('font', {color: 'red'}).t('Google!!!') // the jabber client receives Google!!! in red color.
console.log('Serialized document:', reply.root().toString());
if (firstMessage)
{
firstMessage = false
}
else{
firstMessage = true;
client.send(reply);
}
}
from ltx.
Looks like an issue with your client, not with ltx.
from ltx.
from ltx.
Related Issues (20)
- Unable to parse xml with multiline comment HOT 4
- Unexpected token '>' when running uglifyJS HOT 4
- Missing `end` event, ltx parser. HOT 3
- stricter LtxParser HOT 1
- version 3.0.0 HOT 1
- tagString should ignore `null/undefined` substitutions
- toString() function encodes XML escape characters by default HOT 5
- Dead Docs link in README HOT 3
- Performance improvement HOT 4
- Uglify Js error on version 2.7.2 HOT 2
- PR #126 should have been in 3.0 HOT 2
- XML conversion to DOM and then back to XML removes comment HOT 1
- CDATA bug HOT 3
- clone should preserve the xmlns if it is set on the parent HOT 1
- `ltx.stringify` should escape XML specific chars correctly HOT 2
- Move away from vows
- Documentation?
- Error when importing CommonJS module
- Removal of toJSON should be a major version upgrade? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ltx.