diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-03-07 10:34:46 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-07 10:34:46 +0900 |
commit | 9bd3aaf3dc63fbb0816e0f66631b51d9dd02b5a0 (patch) | |
tree | c4c34bbeaf67cd70a3eac4a418c94263025f2f7a | |
parent | f1c6c22e84001f175dec2f0f451dbadb2fad8b80 (diff) | |
parent | 1f71cb3944b6e917321e2026d79a8877b4dd1426 (diff) | |
download | sphinx-git-9bd3aaf3dc63fbb0816e0f66631b51d9dd02b5a0.tar.gz |
Merge branch '1.7' into 4701_viewcode
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | sphinx/ext/autosummary/__init__.py | 5 | ||||
-rw-r--r-- | sphinx/locale/de/LC_MESSAGES/sphinx.mo | bin | 21590 -> 21603 bytes | |||
-rw-r--r-- | sphinx/locale/de/LC_MESSAGES/sphinx.po | 2 | ||||
-rw-r--r-- | sphinx/locale/pl/LC_MESSAGES/sphinx.mo | bin | 22452 -> 22461 bytes | |||
-rw-r--r-- | tests/test_ext_autosummary.py | 4 |
6 files changed, 10 insertions, 2 deletions
@@ -20,6 +20,7 @@ Bugs fixed * #4685: autosummary emits meaningless warnings * autodoc: crashed when invalid options given * pydomain: always strip parenthesis if empty (refs: #1042) +* #4689: autosummary: unexpectedly strips docstrings containing "i.e." * #4701: viewcode: Misplaced ``<div>`` in viewcode html output Testing diff --git a/sphinx/ext/autosummary/__init__.py b/sphinx/ext/autosummary/__init__.py index 19046112a..73128a631 100644 --- a/sphinx/ext/autosummary/__init__.py +++ b/sphinx/ext/autosummary/__init__.py @@ -90,6 +90,9 @@ if TYPE_CHECKING: logger = logging.getLogger(__name__) +periods_re = re.compile('\.(?:\s+)') + + # -- autosummary_toc node ------------------------------------------------------ class autosummary_toc(nodes.comment): @@ -466,7 +469,7 @@ def extract_summary(doc, document): break # Try to find the "first sentence", which may span multiple lines - sentences = " ".join(doc).split('.') + sentences = periods_re.split(" ".join(doc)) # type: ignore if len(sentences) == 1: summary = sentences[0].strip() else: diff --git a/sphinx/locale/de/LC_MESSAGES/sphinx.mo b/sphinx/locale/de/LC_MESSAGES/sphinx.mo Binary files differindex 90279db40..a5fc48e2c 100644 --- a/sphinx/locale/de/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/de/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/de/LC_MESSAGES/sphinx.po b/sphinx/locale/de/LC_MESSAGES/sphinx.po index 20d62cd75..0649d7833 100644 --- a/sphinx/locale/de/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/de/LC_MESSAGES/sphinx.po @@ -1331,7 +1331,7 @@ msgstr "Release" #: sphinx/writers/latex.py:714 msgid "continues on next page" -msgstr "" +msgstr "Fortsetzung auf der nächsten Seite" #: sphinx/writers/latex.py:718 msgid "page" diff --git a/sphinx/locale/pl/LC_MESSAGES/sphinx.mo b/sphinx/locale/pl/LC_MESSAGES/sphinx.mo Binary files differindex 97c8bd867..03b1761b9 100644 --- a/sphinx/locale/pl/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/pl/LC_MESSAGES/sphinx.mo diff --git a/tests/test_ext_autosummary.py b/tests/test_ext_autosummary.py index f988195a9..3c707b65f 100644 --- a/tests/test_ext_autosummary.py +++ b/tests/test_ext_autosummary.py @@ -77,6 +77,10 @@ def test_extract_summary(capsys): 'it does not break sentence.'] assert extract_summary(doc, document) == ' '.join(doc) + # abbreviations + doc = ['Blabla, i.e. bla.'] + assert extract_summary(doc, document) == 'Blabla, i.e.' + _, err = capsys.readouterr() assert err == '' |