mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-14 09:22:11 -05:00
Fixed an bug with docstring outdenting in the autodoc extension
This commit is contained in:
1 parent
a3db873c47
commit
7cf390aa9b
1 file changed
+4
-3
@@ -172,11 +172,12 @@ def prepare_docstring(s):
|
||||
lines[0] = lines[0].lstrip()
|
||||
if margin < sys.maxint:
|
||||
for i in range(1, len(lines)): lines[i] = lines[i][margin:]
|
||||
# Remove any trailing or leading blank lines.
|
||||
while lines and not lines[-1]:
|
||||
lines.pop()
|
||||
# Remove any leading blank lines.
|
||||
while lines and not lines[0]:
|
||||
lines.pop(0)
|
||||
# make sure there is an empty line at the end
|
||||
if lines and lines[-1]:
|
||||
lines.append('')
|
||||
return lines
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user