From 2d1a2563d6c104a4d10b1f0bb9b64ede25ff152f Mon Sep 17 00:00:00 2001 From: AWS CDK Automation <43080478+aws-cdk-automation@users.noreply.github.com> Date: Tue, 11 Jun 2024 17:24:39 +0200 Subject: [PATCH] fix(docs): remove newlines on windows by replacing carriage return `\r\n` with spaces (backport #1058) (#1075) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Backport This will backport the following commits from `main` to `maintenance/v5.2`: - [fix(docs): remove newlines on windows by replacing carriage return `\r\n` with spaces (#1058)](https://github.com/aws/jsii-compiler/pull/1058) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) Co-authored-by: Eligio MariƱo <22875166+gmeligio@users.noreply.github.com> --- src/docs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docs.ts b/src/docs.ts index 708bcd10..279bde6f 100644 --- a/src/docs.ts +++ b/src/docs.ts @@ -201,7 +201,7 @@ export function splitSummary(docBlock: string | undefined): [string | undefined, * Replace newlines with spaces for use in tables */ function noNewlines(s: string) { - return s.replace(/\n/g, ' '); + return s.replace(/\r?\n/g, ' '); } function endWithPeriod(s: string) {