diff --git a/CHANGES b/CHANGES index 645a6cd4c9d..e054883881d 100644 --- a/CHANGES +++ b/CHANGES @@ -44,6 +44,7 @@ Bugs fixed Patch by Ralf Grubenmann. * #11529: Line Block in LaTeX builder outputs spurious empty token. Patch by Adrian Vollmer. +* #11196: autosummary: Summary line extraction failed with "e.g." Testing ------- diff --git a/sphinx/ext/autosummary/__init__.py b/sphinx/ext/autosummary/__init__.py index ddee2fa5a83..ff948d83d5f 100644 --- a/sphinx/ext/autosummary/__init__.py +++ b/sphinx/ext/autosummary/__init__.py @@ -100,7 +100,7 @@ periods_re = re.compile(r'\.(?:\s+)') literal_re = re.compile(r'::\s*$') -WELL_KNOWN_ABBREVIATIONS = ('et al.', ' i.e.',) +WELL_KNOWN_ABBREVIATIONS = ('et al.', 'e.g.', 'i.e.') # -- autosummary_toc node ------------------------------------------------------ diff --git a/tests/test_ext_autosummary.py b/tests/test_ext_autosummary.py index 0f917df1e38..93cf195af55 100644 --- a/tests/test_ext_autosummary.py +++ b/tests/test_ext_autosummary.py @@ -102,6 +102,15 @@ def test_extract_summary(capsys): doc = ['Blabla, i.e. bla.'] assert extract_summary(doc, document) == ' '.join(doc) + doc = ['Blabla, (i.e. bla).'] + assert extract_summary(doc, document) == ' '.join(doc) + + doc = ['Blabla, e.g. bla.'] + assert extract_summary(doc, document) == ' '.join(doc) + + doc = ['Blabla, (e.g. bla).'] + assert extract_summary(doc, document) == ' '.join(doc) + doc = ['Blabla, et al. bla.'] assert extract_summary(doc, document) == ' '.join(doc)