Permalink
Browse files

DocumentationExtraction: Fix newline parsing

For documentation comments where marker[1] = "", empty newlines
are not considered since they do not have the indentation.
  • Loading branch information...
SanketDG committed Jul 16, 2016
1 parent 156adc5 commit 07135f5e9cf6d2f99d205e7960da6f390b106c38
@@ -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
@@ -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')]]

0 comments on commit 07135f5

Please sign in to comment.