Commits

Georg Brandl  committed e64145e

#258: get a bit smarter about closing double quotes.

  • Participants
  • Parent commits 58b98a9

Comments (0)

Files changed (1)

File sphinx/util/smartypants.py

 # Constants for quote education.
 
 punct_class = r"""[!"#\$\%'()*+,-.\/:;<=>?\@\[\\\]\^_`{|}~]"""
+end_of_word_class = r"""[\s.,;:!?)]"""
 close_class = r"""[^\ \t\r\n\[\{\(\-]"""
 dec_dashes = r"""&#8211;|&#8212;"""
 
 closing_double_quotes_regex = re.compile(r"""
                 #(%s)?   # character that indicates the quote should be closing
                 "
-                (?=\s)
-                """ % (close_class,), re.VERBOSE)
+                (?=%s)
+                """ % (close_class, end_of_word_class), re.VERBOSE)
 
 closing_double_quotes_regex_2 = re.compile(r"""
                 (%s)   # character that indicates the quote should be closing