mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Heuristics processing: Fix bug in italicize regeps that could cuase a scenebreak consisting of multiple underscores to be prefixed by the word None. Fixes #8960 (Multiple hyphens in TXT input causing None to be inserted into text)
This commit is contained in:
parent
f1bd291140
commit
c6aaa3b7b6
@ -156,17 +156,17 @@ class HeuristicProcessor(object):
|
||||
]
|
||||
|
||||
ITALICIZE_STYLE_PATS = [
|
||||
r'(?msu)(?<=[\s>])_(?P<words>[^_]+)?_',
|
||||
r'(?msu)(?<=[\s>])/(?P<words>[^/]+)?/',
|
||||
r'(?msu)(?<=[\s>])~~(?P<words>[^~]+)?~~',
|
||||
r'(?msu)(?<=[\s>])\*(?P<words>[^\*]+)?\*',
|
||||
r'(?msu)(?<=[\s>])~(?P<words>[^~]+)?~',
|
||||
r'(?msu)(?<=[\s>])_/(?P<words>[^/_]+)?/_',
|
||||
r'(?msu)(?<=[\s>])_\*(?P<words>[^\*_]+)?\*_',
|
||||
r'(?msu)(?<=[\s>])\*/(?P<words>[^/\*]+)?/\*',
|
||||
r'(?msu)(?<=[\s>])_\*/(?P<words>[^\*_]+)?/\*_',
|
||||
r'(?msu)(?<=[\s>])/:(?P<words>[^:/]+)?:/',
|
||||
r'(?msu)(?<=[\s>])\|:(?P<words>[^:\|]+)?:\|',
|
||||
r'(?msu)(?<=[\s>])_(?P<words>[^_]+)_',
|
||||
r'(?msu)(?<=[\s>])/(?P<words>[^/]+)/',
|
||||
r'(?msu)(?<=[\s>])~~(?P<words>[^~]+)~~',
|
||||
r'(?msu)(?<=[\s>])\*(?P<words>[^\*]+)\*',
|
||||
r'(?msu)(?<=[\s>])~(?P<words>[^~]+)~',
|
||||
r'(?msu)(?<=[\s>])_/(?P<words>[^/_]+)/_',
|
||||
r'(?msu)(?<=[\s>])_\*(?P<words>[^\*_]+)\*_',
|
||||
r'(?msu)(?<=[\s>])\*/(?P<words>[^/\*]+)/\*',
|
||||
r'(?msu)(?<=[\s>])_\*/(?P<words>[^\*_]+)/\*_',
|
||||
r'(?msu)(?<=[\s>])/:(?P<words>[^:/]+):/',
|
||||
r'(?msu)(?<=[\s>])\|:(?P<words>[^:\|]+):\|',
|
||||
]
|
||||
|
||||
for word in ITALICIZE_WORDS:
|
||||
|
Loading…
x
Reference in New Issue
Block a user