mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-02-05 21:15:12 +01:00
Added ellipsis substitutions to the smarten punctuation option
This commit is contained in:
parent
bb5a05a792
commit
13dbd42f35
1 changed files with 3 additions and 0 deletions
|
|
@ -554,5 +554,8 @@ def smarten_punctuation(self, html):
|
|||
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…
Reference in a new issue