diff options
Diffstat (limited to 'commandBookmarklet.js')
-rw-r--r-- | commandBookmarklet.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/commandBookmarklet.js b/commandBookmarklet.js index d25d338..989c301 100644 --- a/commandBookmarklet.js +++ b/commandBookmarklet.js @@ -17,11 +17,12 @@ } } + const regex = /[^a-zA-Z]/; items.forEach(function(item) { var [url, title] = [item.url, item.title]; var desc = title; title = escape( title.replace(/ +/g,'').toLowerCase() ); - if (/[^a-zA-Z]+/.test(title)) { + if (regex.test(title)) { title = "bm"+title.replace(/[^a-zA-Z]+/g,''); title = title.substr(0, title.length>50?50:title.length); } |