mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch '1.7' into 4701_viewcode
This commit is contained in:
1
CHANGES
1
CHANGES
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Binary file not shown.
@@ -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"
|
||||
|
||||
Binary file not shown.
@@ -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 == ''
|
||||
|
||||
|
||||
Reference in New Issue
Block a user