diff --git a/CHANGES b/CHANGES index 3077ee31c..d76c26f78 100644 --- a/CHANGES +++ b/CHANGES @@ -36,6 +36,9 @@ Bugs fixed * #908: On Python 3, handle error messages from LaTeX correctly in the pngmath extension. +* #943: In autosummary, recognize "first sentences" to pull from the docstring + if they contain uppercase letters. + Documentation ------------- diff --git a/sphinx/ext/autosummary/__init__.py b/sphinx/ext/autosummary/__init__.py index a73e79f5b..af0fa65cf 100644 --- a/sphinx/ext/autosummary/__init__.py +++ b/sphinx/ext/autosummary/__init__.py @@ -199,7 +199,6 @@ class Autosummary(Directive): nodes = self.get_table(items) if 'toctree' in self.options: - suffix = env.config.source_suffix dirname = posixpath.dirname(env.docname) tree_prefix = self.options['toctree'].strip() @@ -276,7 +275,7 @@ class Autosummary(Directive): while doc and not doc[0].strip(): doc.pop(0) - m = re.search(r"^([A-Z][^A-Z]*?\.\s)", " ".join(doc).strip()) + m = re.search(r"^([A-Z].*?\.)(?:\s|$)", " ".join(doc).strip()) if m: summary = m.group(1).strip() elif doc: