Subject: | Strip whitespace from start and end of tags |
Hey,
I noticed sometimes that when I select tags from my list of tags when entering a new bookmark that whitespace was added to the start of the tag string. Rubric then rejected the form because of "invalid" characteres.
The attached patch strips off that whitespace.
I also noticed problems with @private not working, I've fixed them locally. Is this still a problem in CVS?
Cheers!
diff -ruN -x debian -x blib -x Makefile -x rubric.db Rubric-0.11_02.orig/lib/Rubric/Entry.pm Rubric-0.11_02.postgresql/lib/Rubric/Entry.pm
--- Rubric-0.11_02.orig/lib/Rubric/Entry.pm 2005-06-10 14:18:09.000000000 +1200
+++ Rubric-0.11_02.postgresql/lib/Rubric/Entry.pm 2005-07-04 16:54:24.000000000 +1200
@@ -202,6 +212,9 @@
_utf8_on($tagstring);
+ $tagstring =~ s/^\s+//;
+ $tagstring =~ s/\s+$//;
+
my %tags = $tagstring ? map { (index($_, ':') > 0) ? split(/:/, $_, 2) : ($_ => undef) }
split /(?:\+|\s)+/, $tagstring
: ();