Skip to content

Commit

Permalink
DocumentationExtraction: Fix newline parsing
Browse files Browse the repository at this point in the history
For documentation comments where marker[1] = "", empty newlines
are not considered since they do not have the indentation.
  • Loading branch information
SanketDG committed Aug 14, 2016
1 parent 156adc5 commit 07135f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -36,7 +36,8 @@ def _extract_doc_comment_simple(content, line, column, markers):
while line < len(content):
pos = content[line].find(markers[2])
if pos == -1:
doc_comment += content[line][align_column:]
doc_comment += ("\n" if content[line][align_column:] == ""
else content[line][align_column:])
else:
doc_comment += content[line][align_column:pos]
return line, pos + len(markers[2]), doc_comment
Expand Down
Expand Up @@ -121,11 +121,11 @@ def test_python_default(self):
'\nthis is intended.\n')],
[self.Description(desc=' Docstring inline with triple quotes.\n'
' Continues here. ')],
[self.Description(desc='\nThis is the best docstring ever!\n'),
[self.Description(desc='\nThis is the best docstring ever!\n\n'),
self.Parameter(name='param1:',
desc=' Very Very Long Parameter description.\n'),
self.Parameter(name='param2:',
desc=' Short Param description.\n'),
desc=' Short Param description.\n\n'),
self.ReturnValue(desc='Long Return Description That Makes No Sense'
' And Will\n Cut to the Next'
' Line.\n')]]
Expand Down

0 comments on commit 07135f5

Please sign in to comment.