Skip to content

Commit f6a8c35

Browse files
committed
Fix notice detection.
1 parent 9b51015 commit f6a8c35

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Contents/Resources/js/jlatt.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
(function() {
2-
var NOTICE_REGEX = /^\(notice\) '/;
2+
var NOTICE_REGEX = /^\(notice\)\s*/;
33
var HTML_SENDER_REGEX = /^(GitHub|Jenkins|Heroku|Pivotal)$/;
44

55
$('#Chat').on('DOMNodeInserted', '.line:not(.html-fixed)', function(e) {
66
var $line = $(this).addClass('html-fixed');
77
var $text = $line.find('.text');
8-
var message = $text.text();
98

9+
var message = $text.html();
1010
if (NOTICE_REGEX.test(message)) {
11-
message = message.replace(NOTICE_REGEX, '');
11+
$text.html(message.replace(NOTICE_REGEX, ''));
1212
$line.addClass('notice');
1313
}
1414

1515
var sender = $line.find('.sender .name').text();
1616
if (HTML_SENDER_REGEX.test(sender)) {
17-
$text.html(message);
17+
$text.html($text.text());
1818
}
1919
});
2020
}).call(this);

0 commit comments

Comments
 (0)