fix: normalize Windows CRLF line endings in clipboard text (#20283)

On Windows, clipboard text uses CRLF (\r\n) line endings which can cause newlines to be lost or displayed incorrectly when pasted via the {{CLIPBOARD}} variable.

Fixed by converting CRLF to LF before inserting clipboard text.

Fixes #19370
This commit is contained in:
Classic298
2025-12-31 08:22:13 +01:00
committed by GitHub
parent 450421b189
commit 2acee80829
2 changed files with 2 additions and 2 deletions

View File

@@ -126,7 +126,7 @@
}
}
text = text.replaceAll('{{CLIPBOARD}}', clipboardText);
text = text.replaceAll('{{CLIPBOARD}}', clipboardText.replaceAll('\r\n', '\n'));
}
if (text.includes('{{USER_LOCATION}}')) {

View File

@@ -200,7 +200,7 @@
}
}
text = text.replaceAll('{{CLIPBOARD}}', clipboardText);
text = text.replaceAll('{{CLIPBOARD}}', clipboardText.replaceAll('\r\n', '\n'));
}
if (text.includes('{{USER_LOCATION}}')) {