Skip to content

Commit cfc7da8

Browse files
committed
PR feedback
1 parent e83c807 commit cfc7da8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/integrations/misc/extract-text.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ export function stripLineNumbers(content: string, aggressive: boolean = false):
165165
const lineEnding = content.includes("\r\n") ? "\r\n" : "\n"
166166
let result = processedLines.join(lineEnding)
167167

168-
// Preserve trailing newline if original content had one
169-
if (content.endsWith("\n") || content.endsWith("\r\n")) {
170-
if (!result.endsWith("\n") && !result.endsWith("\r\n")) {
168+
// Preserve trailing newline if present in original content
169+
if (content.endsWith(lineEnding)) {
170+
if (!result.endsWith(lineEnding)) {
171171
result += lineEnding
172172
}
173173
}

0 commit comments

Comments
 (0)