codify: only match if preceded by whitespace
(or at the start of the line). Fixes #1058
This commit is contained in:
parent
6ab4ef7d88
commit
fd40cc1593
@ -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 = '<span class="hidden-bracket">`</span><code>' + code + '</code><span class="hidden-bracket">`</span>';
|
||||
var re = /(^|\s)`(.+?)`/g;
|
||||
return text.replace(re, function(match, ws, code) {
|
||||
var rr = ws + '<span class="hidden-bracket">`</span><code>' + code + '</code><span class="hidden-bracket">`</span>';
|
||||
return rr;
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user