From: Damyan Ivanov Date: Sat, 21 May 2011 05:22:03 +0000 (+0300) Subject: trimWord: simplify cleaning X-Git-Tag: 1.6~6 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=d87756e03abd9f0418f78c8cea63d53706e1c501;p=icedeb.git trimWord: simplify cleaning a keyword should start and end in a letter/digit --- diff --git a/chrome/content/icedeb.js b/chrome/content/icedeb.js index 061f3cd..a8f2e9c 100644 --- a/chrome/content/icedeb.js +++ b/chrome/content/icedeb.js @@ -37,10 +37,8 @@ IceDeb = { do { oldword = word; - word = word.replace(/^\s+/, ''); - word = word.replace(/\s+$/, ''); - word = word.replace(/^#/, ''); - word = word.replace(/[-:\/,.]$/, ''); + word = word.replace(/^[^a-zA-Z0-9]+/, ''); + word = word.replace(/[^a-zA-Z0-9]+$/, ''); } while ( oldword != word ); return word;