mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
E-book viewer: Fix sorting of highlights incorrect in books that use HTML ids with a hyphen in them. Fixes #1951507 [Private bug](https://bugs.launchpad.net/calibre/+bug/1951507)
This commit is contained in:
parent
dec5cb9d20
commit
d0c5241e97
@ -17,7 +17,7 @@ class Parser:
|
||||
|
||||
def __init__(self):
|
||||
# All allowed unicode characters + escaped special characters
|
||||
special_char = r'[\[\](),;=^]'
|
||||
special_char = r'[\[\](),;=^-]'
|
||||
unescaped_char = '[[\t\n\r -\ud7ff\ue000-\ufffd\U00010000-\U0010ffff]--%s]' % special_char
|
||||
escaped_char = r'\^' + special_char
|
||||
chars = r'(?:%s|(?:%s))+' % (unescaped_char, escaped_char)
|
||||
|
@ -86,6 +86,7 @@ class Tests(unittest.TestCase):
|
||||
|
||||
# Test parsing of text assertions
|
||||
('/1:3[aa^,b]', a('aa,b'), ''),
|
||||
('/1:3[aa^-b]', a('aa-b'), ''),
|
||||
('/1:3[aa^,b,c1]', a('aa,b', 'c1'), ''),
|
||||
('/1:3[,aa^,b]', a(after='aa,b'), ''),
|
||||
('/1:3[;s=a]', a(s='a'), ''),
|
||||
|
Loading…
x
Reference in New Issue
Block a user