diff --git a/js/filters.js b/js/filters.js
index ffbe35f..509503e 100644
--- a/js/filters.js
+++ b/js/filters.js
@@ -239,9 +239,9 @@ weechat.filter('prefixlimit', function() {
weechat.filter('codify', function() {
return function(text) {
- var re = /`(.+?)`/g;
- return text.replace(re, function(match, code) {
- var rr = '`' + code + '
`';
+ var re = /(^|\s)`(.+?)`/g;
+ return text.replace(re, function(match, ws, code) {
+ var rr = ws + '`' + code + '
`';
return rr;
});
};