mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #772267 (TXT to EPUB: Underlined words (following quotes?) fail to become italics) and fix bug when killing threaded jobs
This commit is contained in:
commit
df074821c4
@ -156,17 +156,17 @@ class HeuristicProcessor(object):
|
|||||||
]
|
]
|
||||||
|
|
||||||
ITALICIZE_STYLE_PATS = [
|
ITALICIZE_STYLE_PATS = [
|
||||||
r'(?msu)(?<=[\s>])_(?P<words>[^_]+)_',
|
ur'(?msu)(?<=[\s>"“\'‘])_(?P<words>[^_]+)_',
|
||||||
r'(?msu)(?<=[\s>])/(?P<words>[^/\*>]+)/',
|
ur'(?msu)(?<=[\s>"“\'‘])/(?P<words>[^/\*>]+)/',
|
||||||
r'(?msu)(?<=[\s>])~~(?P<words>[^~]+)~~',
|
ur'(?msu)(?<=[\s>"“\'‘])~~(?P<words>[^~]+)~~',
|
||||||
r'(?msu)(?<=[\s>])\*(?P<words>[^\*]+)\*',
|
ur'(?msu)(?<=[\s>"“\'‘])\*(?P<words>[^\*]+)\*',
|
||||||
r'(?msu)(?<=[\s>])~(?P<words>[^~]+)~',
|
ur'(?msu)(?<=[\s>"“\'‘])~(?P<words>[^~]+)~',
|
||||||
r'(?msu)(?<=[\s>])_/(?P<words>[^/_]+)/_',
|
ur'(?msu)(?<=[\s>"“\'‘])_/(?P<words>[^/_]+)/_',
|
||||||
r'(?msu)(?<=[\s>])_\*(?P<words>[^\*_]+)\*_',
|
ur'(?msu)(?<=[\s>"“\'‘])_\*(?P<words>[^\*_]+)\*_',
|
||||||
r'(?msu)(?<=[\s>])\*/(?P<words>[^/\*]+)/\*',
|
ur'(?msu)(?<=[\s>"“\'‘])\*/(?P<words>[^/\*]+)/\*',
|
||||||
r'(?msu)(?<=[\s>])_\*/(?P<words>[^\*_]+)/\*_',
|
ur'(?msu)(?<=[\s>"“\'‘])_\*/(?P<words>[^\*_]+)/\*_',
|
||||||
r'(?msu)(?<=[\s>])/:(?P<words>[^:/]+):/',
|
ur'(?msu)(?<=[\s>"“\'‘])/:(?P<words>[^:/]+):/',
|
||||||
r'(?msu)(?<=[\s>])\|:(?P<words>[^:\|]+):\|',
|
ur'(?msu)(?<=[\s>"“\'‘])\|:(?P<words>[^:\|]+):\|',
|
||||||
]
|
]
|
||||||
|
|
||||||
for word in ITALICIZE_WORDS:
|
for word in ITALICIZE_WORDS:
|
||||||
|
@ -112,7 +112,7 @@ class ThreadedJob(BaseJob):
|
|||||||
self.start_time = time.time()
|
self.start_time = time.time()
|
||||||
self.duration = 0.0001
|
self.duration = 0.0001
|
||||||
else:
|
else:
|
||||||
self.duration = time.time() - self.start_time()
|
self.duration = time.time() - self.start_time
|
||||||
self.abort.set()
|
self.abort.set()
|
||||||
|
|
||||||
self.log('Aborted job:', self.description)
|
self.log('Aborted job:', self.description)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user