Here my method which transform a String (message) and send it to the muc.
Message msg = muc.createMessage();
msg.setBody(message);
XHTMLText xhtmlText = new XHTMLText(null, null);
xhtmlText.appendOpenSpanTag(“color:blue”);
xhtmlText.append(message);
xhtmlText.appendCloseSpanTag();
XHTMLManager.addBody(msg, xhtmlText.toString());
muc.sendMessage(msg);
The problem is that message contains spaces which mustn’t be ignored (3 spaces next to each other) so I’d like to transform to the unbreakable space but I can’t because the html code is transformed. Same problem with \n and br.
How can I do ? Without hack if possible.
Thank you.