From 55d45a6fb156dbfe85588878a1e4dc2109699fef Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Fri, 30 May 2025 11:19:12 -0400 Subject: [PATCH] Code review: safer to split on official line separator Will still join lines using the detected line separator. --- src/js/resources/json-edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/resources/json-edit.js b/src/js/resources/json-edit.js index 4b03bfd08..39dec68c2 100644 --- a/src/js/resources/json-edit.js +++ b/src/js/resources/json-edit.js @@ -375,7 +375,7 @@ registerScriptlet(trustedJsonEditFetchResponse, { function jsonlEditFn(jsonp, text = '') { const safe = safeSelf(); const lineSeparator = /\r?\n/.exec(text)?.[0] || '\n'; - const linesBefore = text.split(lineSeparator); + const linesBefore = text.split('\n'); const linesAfter = []; for ( const lineBefore of linesBefore ) { let obj;