forked from 0x2620/pandora
sort string should start with letters or numbers, fixes #19
This commit is contained in:
parent
59460cdb85
commit
ef3083ab2c
1 changed files with 2 additions and 0 deletions
|
@ -139,6 +139,8 @@ class Annotation(models.Model):
|
||||||
self.findvalue = ox.decode_html(ox.strip_tags(re.sub('<br */?>\n?', ' ', self.value))).replace('\n', ' ')
|
self.findvalue = ox.decode_html(ox.strip_tags(re.sub('<br */?>\n?', ' ', self.value))).replace('\n', ' ')
|
||||||
self.findvalue = unicodedata.normalize('NFKD', self.findvalue).lower()
|
self.findvalue = unicodedata.normalize('NFKD', self.findvalue).lower()
|
||||||
sortvalue = sort_string(self.findvalue)
|
sortvalue = sort_string(self.findvalue)
|
||||||
|
while sortvalue and not unicodedata.category(sortvalue[0])[0] in ('L', 'N'):
|
||||||
|
sortvalue = sortvalue[1:]
|
||||||
if sortvalue:
|
if sortvalue:
|
||||||
self.sortvalue = sortvalue[:900]
|
self.sortvalue = sortvalue[:900]
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue