diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-03-24 01:22:30 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-04-25 21:44:44 +0900 |
commit | 1ea23e14df871ff97aa4082dddecfd11c4465cbe (patch) | |
tree | 9be4792098d586afa0d18af089cb6ea9dd305fdc /sphinx/util/docstrings.py | |
parent | de0c44196e6c9f8ea9ec5dd58098f83dae93277d (diff) | |
download | sphinx-git-1ea23e14df871ff97aa4082dddecfd11c4465cbe.tar.gz |
Fix #6165: autodoc: ``tab_width`` setting of docutils has been ignored
Diffstat (limited to 'sphinx/util/docstrings.py')
-rw-r--r-- | sphinx/util/docstrings.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sphinx/util/docstrings.py b/sphinx/util/docstrings.py index 97dd60294..31943b2cb 100644 --- a/sphinx/util/docstrings.py +++ b/sphinx/util/docstrings.py @@ -15,8 +15,8 @@ if False: from typing import List # NOQA -def prepare_docstring(s, ignore=1): - # type: (str, int) -> List[str] +def prepare_docstring(s, ignore=1, tabsize=8): + # type: (str, int, int) -> List[str] """Convert a docstring into lines of parseable reST. Remove common leading indentation, where the indentation of a given number of lines (usually just one) is ignored. @@ -25,7 +25,7 @@ def prepare_docstring(s, ignore=1): ViewList (used as argument of nested_parse().) An empty line is added to act as a separator between this docstring and following content. """ - lines = s.expandtabs().splitlines() + lines = s.expandtabs(tabsize).splitlines() # Find minimum indentation of any non-blank lines after ignored lines. margin = sys.maxsize for line in lines[ignore:]: |