Merge branch '1.7' into 4701_viewcode

This commit is contained in:
Takeshi KOMIYA
2018-03-07 10:34:46 +09:00
committed by GitHub
6 changed files with 10 additions and 2 deletions

View File

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

View File

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

View File

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

View File

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