diff --git a/js/client.js b/js/client.js
index 01b6dd92c..655e6245c 100644
--- a/js/client.js
+++ b/js/client.js
@@ -1893,7 +1893,7 @@
name = '(empty room)';
}
}
- return buf + '' + formatid + '' + name + '';
+ return buf + '' + Tools.escapeFormat(formatid) + '' + name + '';
} else {
return buf + ' ' + (Tools.escapeHTML(room.title) || (id === 'lobby' ? 'Lobby' : id)) + '';
}