mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Added ellipsis substitutions to the smarten punctuation option
This commit is contained in:
parent
bb5a05a792
commit
13dbd42f35
@ -554,5 +554,8 @@ class HTMLPreProcessor(object):
|
||||
html = smartyPants(html)
|
||||
html = html.replace(start, '<!--')
|
||||
html = html.replace(stop, '-->')
|
||||
# convert ellipsis to entities to prevent unwrapping
|
||||
html = re.sub('(?u)(?<=\w)(\.\s?){3}', '…', html)
|
||||
html = re.sub('(?u)(?<=\w)\s(\.\s?){3}', ' …', html)
|
||||
return substitute_entites(html)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user