File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 33https://github.com/josdejong/jsoneditor
44
55
6+ ## not yet published, version 9.5.6
7+
8+ - Fix inefficient regex to replace return characters.
9+
10+
611## 2021-09-01, version 9.5.5
712
813- Fix ` setMode ` not throwing an exception anymore in case of a parse error
Original file line number Diff line number Diff line change @@ -399,8 +399,8 @@ export function getInnerText (element, buffer) {
399399
400400 // text node
401401 if ( element . nodeValue ) {
402- // remove return characters and the whitespace surrounding return characters
403- const trimmedValue = element . nodeValue . replace ( / \ s* \n \s * / g, '' )
402+ // remove return characters and the whitespaces surrounding those return characters
403+ const trimmedValue = element . nodeValue . replace ( / ( \b | ^ ) \ s* \n \s * ( \b | $ ) / g, '' )
404404 if ( trimmedValue !== '' ) {
405405 return buffer . flush ( ) + trimmedValue
406406 } else {
You can’t perform that action at this time.
0 commit comments