From 65ca7aa0c9e23dbe25dc49bf57131175be882186 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sat, 28 Nov 2020 11:41:04 +0900 Subject: [PATCH] Fix #8501: autosummary: summary extraction splits text after "el at." Add "el at." to the list of abbreviations. --- CHANGES | 1 + sphinx/ext/autosummary/__init__.py | 2 +- tests/test_ext_autosummary.py | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 181e1f961..051210be8 100644 --- a/CHANGES +++ b/CHANGES @@ -64,6 +64,7 @@ Bugs fixed information of TypeVars * #8477: autosummary: non utf-8 reST files are generated when template contains multibyte characters +* #8501: autosummary: summary extraction splits text after "el at." unexpectedly * #8419: html search: Do not load ``language_data.js`` in non-search pages * #8454: graphviz: The layout option for graph and digraph directives don't work * #8131: linkcheck: Use GET when HEAD requests cause Too Many Redirects, to diff --git a/sphinx/ext/autosummary/__init__.py b/sphinx/ext/autosummary/__init__.py index 0d2353583..ffe2e2dc1 100644 --- a/sphinx/ext/autosummary/__init__.py +++ b/sphinx/ext/autosummary/__init__.py @@ -98,7 +98,7 @@ logger = logging.getLogger(__name__) periods_re = re.compile(r'\.(?:\s+)') literal_re = re.compile(r'::\s*$') -WELL_KNOWN_ABBREVIATIONS = (' i.e.',) +WELL_KNOWN_ABBREVIATIONS = ('et al.', ' i.e.',) # -- autosummary_toc node ------------------------------------------------------ diff --git a/tests/test_ext_autosummary.py b/tests/test_ext_autosummary.py index 3832bc963..6e0ca21c7 100644 --- a/tests/test_ext_autosummary.py +++ b/tests/test_ext_autosummary.py @@ -97,6 +97,9 @@ def test_extract_summary(capsys): doc = ['Blabla, i.e. bla.'] assert extract_summary(doc, document) == ' '.join(doc) + doc = ['Blabla, et al. bla.'] + assert extract_summary(doc, document) == ' '.join(doc) + # literal doc = ['blah blah::'] assert extract_summary(doc, document) == 'blah blah.'