Skip Menu |

This queue is for tickets about the HTML-TagCloud CPAN distribution.

Report information
The Basics
Id: 38777
Status: open
Priority: 0/
Queue: HTML-TagCloud

People
Owner: Nobody in particular
Requestors: ask [...] develooper.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



CC: Ask Bjørn Hansen <ask [...] develooper.com>
Subject: [PATCH] lowercase sort the tags; most users don't care that Zebra technically comes before antelope
Date: Thu, 28 Aug 2008 01:17:59 -0700
To: bug-HTML-TagCloud [...] rt.cpan.org
From: Ask Bjørn Hansen <ask [...] develooper.com>
--- lib/perl5/HTML/TagCloud.pm | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/lib/perl5/HTML/TagCloud.pm b/lib/perl5/HTML/TagCloud.pm index 7e0714f..a08a19c 100644 --- a/lib/perl5/HTML/TagCloud.pm +++ b/lib/perl5/HTML/TagCloud.pm @@ -62,7 +62,10 @@ sub tags { $factor *= (scalar @tags/$self->{levels}); } my @tag_items; - foreach my $tag (sort @tags) { + my @sorted = map { $_->[0] } + sort { $a->[1] cmp $b->[1] } + map { [ $_, lc($_) ] } @tags; + foreach my $tag (@sorted) { my $tag_item; $tag_item->{name} = $tag; $tag_item->{count} = $counts->{$tag}; -- 1.6.0
From: trs [...] bestpractical.com
This ticket has been open for years now, but it would still be nice not to have crappy ascii-betical sorting.