Closed linkmauve closed 7 years ago
Thank you for the report @linkmauve. Do you think you might be able to propose a fix?
Possible duplicate of #441?
I just traced through the code and found this same issue.
For a quick fix for my particular install, I just check to see if its a string before allowing it to be treated as an object.
var msg = str; if ( typeof str !== 'string' ) { msg = self.createHtml($(str).get(0), len) } return $("<div/>").append(msg).html();
I agree that this is likely the root cause of #441.
A hint of search candy, the following is an example of the error it'll throw in the console: Syntax error, unrecognized expression: username left the room
.
Same issue for me. The @unshackleddynamo fix/workaround did the job. Thank you.
For dummies or to save time to people not Candy-aware, this is the detailed how-to:
in candy.bundle.js, around line 784, modify the parseAndCropXhtml function. Replace
self.parseAndCropXhtml = function(str, len) {
return $("<div/>").append(self.createHtml($(str).get(0), len)).html();
};
with
self.parseAndCropXhtml = function(str, len) {
var msg = str;
if ( typeof str !== 'string' ) {
msg = self.createHtml($(str).get(0), len)
}
return $("<div/>").append(msg).html();
};
Then
I'm also experiencing #441 and started testing this patch. If works, I'll file a PR.
This was fixed in #492
In src/view/pane/chat.js:291,
onInfoMessage()
, whenCandy.View.getOptions().enableXHTML === true
the message argument will be parsed as XHTML-IM despite having been generated by Candy itself and not being XHTML at all, e.g. in src/view/pane/roster.js:229.Here is a full stacktrace if you are interested (language is 'fr'):