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