Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/docstring/docstring_factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ export class DocstringFactory {
}

private condenseNewLines(snippet: string): string {
return snippet.replace(/\n{3,}/gm, "\n\n");
return snippet.replace(/(?:\r?\n){3,}/gm, "\n\n");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the case of \r\n{3,} should be replaced with\r\n\r\n not \n\n

}

private condenseTrailingNewLines(snippet: string): string {
return snippet.replace(/\n+$/g, "\n");
return snippet.replace(/(?:\r?\n)+$/g, "\n");
}

private commentText(snippet: string): string {
Expand Down