diff options
| author | armin.ronacher <devnull@localhost> | 2008-07-12 00:11:55 +0000 |
|---|---|---|
| committer | armin.ronacher <devnull@localhost> | 2008-07-12 00:11:55 +0000 |
| commit | 7ab43cdfa391f4d647228378a8b2a252529697d2 (patch) | |
| tree | 7998a493fcdca2cd7f1fcaa5c03c9e1c5b82bde3 | |
| parent | e36860f9237a07c6ccdb2ea9316ad809ba50161f (diff) | |
| download | sphinx-7ab43cdfa391f4d647228378a8b2a252529697d2.tar.gz | |
Fixed an bug with docstring outdenting in the autodoc extension
| -rw-r--r-- | sphinx/ext/autodoc.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index b821eb06..45dcb7b9 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -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 |
