autosummary: Extract summary line after "e.g." (#11196)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
grayjk 2023-08-07 17:20:30 -04:00 committed by GitHub
parent 8cd677f929
commit ac2b7599d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View File

@ -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
-------

View File

@ -100,7 +100,7 @@ logger = logging.getLogger(__name__)
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 ------------------------------------------------------

View File

@ -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)