Merge pull request #8505 from tk0miya/8501_extract_summary_el_at

Fix #8501: autosummary: summary extraction splits text after "el at."
This commit is contained in:
Takeshi KOMIYA 2020-11-29 11:48:55 +09:00 committed by GitHub
commit c15c61ed64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View File

@ -67,6 +67,7 @@ Bugs fixed
* #8493: autodoc: references to builtins not working in class aliases * #8493: autodoc: references to builtins not working in class aliases
* #8477: autosummary: non utf-8 reST files are generated when template contains * #8477: autosummary: non utf-8 reST files are generated when template contains
multibyte characters 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 * #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 * #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 * #8131: linkcheck: Use GET when HEAD requests cause Too Many Redirects, to

View File

@ -98,7 +98,7 @@ logger = logging.getLogger(__name__)
periods_re = re.compile(r'\.(?:\s+)') periods_re = re.compile(r'\.(?:\s+)')
literal_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 ------------------------------------------------------ # -- autosummary_toc node ------------------------------------------------------

View File

@ -97,6 +97,9 @@ def test_extract_summary(capsys):
doc = ['Blabla, i.e. bla.'] doc = ['Blabla, i.e. bla.']
assert extract_summary(doc, document) == ' '.join(doc) assert extract_summary(doc, document) == ' '.join(doc)
doc = ['Blabla, et al. bla.']
assert extract_summary(doc, document) == ' '.join(doc)
# literal # literal
doc = ['blah blah::'] doc = ['blah blah::']
assert extract_summary(doc, document) == 'blah blah.' assert extract_summary(doc, document) == 'blah blah.'