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

This commit is contained in:
Georg Brandl 2010-08-05 22:35:12 +02:00
parent 7518d19437
commit 0ed09e9c53

View File

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