diff --git a/4chan_x.user.js b/4chan_x.user.js index 8d789900f..1f57b7104 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -793,9 +793,7 @@ return "\\" + c; } }); - if (type !== 'md5') { - re = "/^" + re + "$/"; - } + re = type === 'md5' ? "/" + value + "/" : "/^" + re + "$/"; if (/\bop\b/.test(post["class"])) { re += ';op:yes'; } diff --git a/script.coffee b/script.coffee index 84f86e394..23818f01f 100644 --- a/script.coffee +++ b/script.coffee @@ -656,7 +656,11 @@ Filter = else "\\#{c}" - re = "/^#{re}$/" unless type is 'md5' + re = + if type is 'md5' + "/#{value}/" + else + "/^#{re}$/" if /\bop\b/.test post.class re += ';op:yes'