Skip to content

Conversation

@justinchuby
Copy link

This change fixes #198, where templates saved with CRLF line returns will generate unwanted trailing white spaces and new lines.


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

@NilsJPWerner
Copy link
Owner

Hi sorry for the delay in checking this. Can you rebase master and add a test case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Templates using CRLF newlines cause extra returns and white spaces

2 participants