mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 12:03:38 +02:00
TXT Input: Tweak Heuristic italicizing.
This commit is contained in:
parent
843e1f2068
commit
f593b21631
1 changed files with 6 additions and 5 deletions
|
|
@ -21,15 +21,15 @@ def __init__(self):
|
|||
]
|
||||
self.ITALICIZE_STYLE_PATS = [
|
||||
r'(?msu)_(?P<words>.+?)_',
|
||||
r'(?msu)/(?P<words>.+?)/',
|
||||
r'(?msu)/(?P<words>[^<>]+?)/',
|
||||
r'(?msu)~~(?P<words>.+?)~~',
|
||||
r'(?msu)\*(?P<words>.+?)\*',
|
||||
r'(?msu)~(?P<words>.+?)~',
|
||||
r'(?msu)_/(?P<words>.+?)/_',
|
||||
r'(?msu)_/(?P<words>[^<>]+?)/_',
|
||||
r'(?msu)_\*(?P<words>.+?)\*_',
|
||||
r'(?msu)\*/(?P<words>.+?)/\*',
|
||||
r'(?msu)_\*/(?P<words>.+?)/\*_',
|
||||
r'(?msu)/:(?P<words>.+?):/',
|
||||
r'(?msu)\*/(?P<words>[^<>]+?)/\*',
|
||||
r'(?msu)_\*/(?P<words>[^<>]+?)/\*_',
|
||||
r'(?msu)/:(?P<words>[^<>]+?):/',
|
||||
r'(?msu)\|:(?P<words>.+?):\|',
|
||||
]
|
||||
|
||||
|
|
@ -84,5 +84,6 @@ def convert(self, txt, title='', epub_split_size_kb=0):
|
|||
|
||||
txt = u'\n'.join(processed)
|
||||
txt = re.sub('[ ]{2,}', ' ', txt)
|
||||
print txt
|
||||
|
||||
return HTML_TEMPLATE % (title, txt)
|
||||
|
|
|
|||
Loading…
Reference in a new issue