From 68729fb975d38000d304e2db1eb121fb194a0e04 Mon Sep 17 00:00:00 2001 From: Jakub Wilk Date: Wed, 20 Nov 2019 11:34:03 +0100 Subject: [PATCH] Fix misplaced flags in re.sub() call The 4th argument of re.sub() is maximum number of substitutions, not flags. --- sphinx/util/smartypants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/util/smartypants.py b/sphinx/util/smartypants.py index 47f8b59b21..43f8bc7248 100644 --- a/sphinx/util/smartypants.py +++ b/sphinx/util/smartypants.py @@ -155,7 +155,7 @@ def educateQuotes(text: str, language: str = 'en') -> str: # Special case for decade abbreviations (the '80s): if language.startswith('en'): # TODO similar cases in other languages? - text = re.sub(r"""'(?=\d{2}s)""", apostrophe, text, re.UNICODE) + text = re.sub(r"""'(?=\d{2}s)""", apostrophe, text, flags=re.UNICODE) close_class = r"""[^\ \t\r\n\[\{\(\-]""" dec_dashes = r"""–|—"""