From ef3083ab2c45d562eba2bb70abe933115c804c5c Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 10 Nov 2013 23:05:07 +0000 Subject: [PATCH] sort string should start with letters or numbers, fixes #19 --- pandora/annotation/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora/annotation/models.py b/pandora/annotation/models.py index cbb9dad26..0938c72a2 100644 --- a/pandora/annotation/models.py +++ b/pandora/annotation/models.py @@ -139,6 +139,8 @@ class Annotation(models.Model): self.findvalue = ox.decode_html(ox.strip_tags(re.sub('
\n?', ' ', self.value))).replace('\n', ' ') self.findvalue = unicodedata.normalize('NFKD', self.findvalue).lower() sortvalue = sort_string(self.findvalue) + while sortvalue and not unicodedata.category(sortvalue[0])[0] in ('L', 'N'): + sortvalue = sortvalue[1:] if sortvalue: self.sortvalue = sortvalue[:900] else: