From 29c6cc1e8269e5847f62db61a0ced152152fe649 Mon Sep 17 00:00:00 2001 From: Serafeim Papastefanos Date: Wed, 3 Jul 2019 10:01:05 +0300 Subject: [PATCH] Add a simple codify filter --- index.html | 2 +- js/filters.js | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 17d51a0..bd587f5 100644 --- a/index.html +++ b/index.html @@ -336,7 +336,7 @@ npm run build-electron-{windows, darwin, linux} <>
+ --> diff --git a/js/filters.js b/js/filters.js index 272f61a..d261c09 100644 --- a/js/filters.js +++ b/js/filters.js @@ -237,4 +237,15 @@ weechat.filter('prefixlimit', function() { }; }); +weechat.filter('codify', function() { + return function(text) { + var re = /(`[^``]+`)/g + + return text.replace(re, function(z) { + var rr = '' + z.slice(1, z.length-1) + ''; + return rr; + }) + }; +}); + })();