diff --git a/src/calibre/utils/smartypants.py b/src/calibre/utils/smartypants.py index 51079e4e47..1bc45b15e4 100644 --- a/src/calibre/utils/smartypants.py +++ b/src/calibre/utils/smartypants.py @@ -696,6 +696,10 @@ def educateQuotes(str): """ % (close_class,), re.VERBOSE) str = closing_double_quotes_regex.sub(r"""\1”""", str) + if str.endswith('-"'): + # A string that endswith -" is sometimes used for dialogue + str = str[:-1] + '”' + # Any remaining quotes should be opening ones. str = re.sub(r'"', r"""“""", str)