We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e83c807 commit cfc7da8Copy full SHA for cfc7da8
src/integrations/misc/extract-text.ts
@@ -165,9 +165,9 @@ export function stripLineNumbers(content: string, aggressive: boolean = false):
165
const lineEnding = content.includes("\r\n") ? "\r\n" : "\n"
166
let result = processedLines.join(lineEnding)
167
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")) {
+ // Preserve trailing newline if present in original content
+ if (content.endsWith(lineEnding)) {
+ if (!result.endsWith(lineEnding)) {
171
result += lineEnding
172
}
173
0 commit comments