From 5609ce459fcacfcdbb5a046964e95d03608757fa Mon Sep 17 00:00:00 2001 From: "gavin%gavinsharp.com" Date: Sat, 17 Jun 2006 21:33:26 +0000 Subject: [PATCH] Bug 217363: bookmark keywords ending in space or containing spaces aren't recognized when used with search terms (smart keywords), patch by Adam Guthrie , r=mconnor git-svn-id: svn://10.0.0.236/trunk@200207 18797224-902f-48f8-a5cc-f745e15eee43 --- .../components/bookmarks/content/bookmarksProperties.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mozilla/browser/components/bookmarks/content/bookmarksProperties.js b/mozilla/browser/components/bookmarks/content/bookmarksProperties.js index b1642051440..aeca30cbb2d 100644 --- a/mozilla/browser/components/bookmarks/content/bookmarksProperties.js +++ b/mozilla/browser/components/bookmarks/content/bookmarksProperties.js @@ -179,9 +179,12 @@ function Commit() if (oldValue) oldValue = oldValue.QueryInterface(Components.interfaces.nsIRDFLiteral); - if (newValue && gFields[i] == "shortcut") + if (newValue && gFields[i] == "shortcut") { // shortcuts are always lowercased internally newValue = newValue.toLowerCase(); + // strip trailing and leading whitespace + newValue = newValue.replace(/(^\s+|\s+$)/g, ''); + } else if (newValue && gFields[i] == "url") { if (newValue.indexOf(":") < 0) // we're dealing with the URL attribute;