@@ -486,7 +486,7 @@ function writeFoldedLines(state: LoaderState, count: number) {
486
486
if ( count === 1 ) {
487
487
state . result += " " ;
488
488
} else if ( count > 1 ) {
489
- state . result += common . repeat ( "\n" , count - 1 ) ;
489
+ state . result += "\n" . repeat ( count - 1 ) ;
490
490
}
491
491
}
492
492
@@ -936,8 +936,7 @@ function readBlockScalar(state: LoaderState, nodeIndent: number): boolean {
936
936
if ( state . lineIndent < textIndent ) {
937
937
// Perform the chomping.
938
938
if ( chomping === CHOMPING_KEEP ) {
939
- state . result += common . repeat (
940
- "\n" ,
939
+ state . result += "\n" . repeat (
941
940
didReadContent ? 1 + emptyLines : emptyLines ,
942
941
) ;
943
942
} else if ( chomping === CHOMPING_CLIP ) {
@@ -957,15 +956,14 @@ function readBlockScalar(state: LoaderState, nodeIndent: number): boolean {
957
956
if ( isWhiteSpace ( ch ) ) {
958
957
atMoreIndented = true ;
959
958
// except for the first content line (cf. Example 8.1)
960
- state . result += common . repeat (
961
- "\n" ,
959
+ state . result += "\n" . repeat (
962
960
didReadContent ? 1 + emptyLines : emptyLines ,
963
961
) ;
964
962
965
963
// End of more-indented block.
966
964
} else if ( atMoreIndented ) {
967
965
atMoreIndented = false ;
968
- state . result += common . repeat ( "\n" , emptyLines + 1 ) ;
966
+ state . result += "\n" . repeat ( emptyLines + 1 ) ;
969
967
970
968
// Just one line break - perceive as the same line.
971
969
} else if ( emptyLines === 0 ) {
@@ -976,16 +974,13 @@ function readBlockScalar(state: LoaderState, nodeIndent: number): boolean {
976
974
977
975
// Several line breaks - perceive as different lines.
978
976
} else {
979
- state . result += common . repeat ( "\n" , emptyLines ) ;
977
+ state . result += "\n" . repeat ( emptyLines ) ;
980
978
}
981
979
982
980
// Literal style: just add exact number of line breaks between content lines.
983
981
} else {
984
982
// Keep all line breaks except the header line break.
985
- state . result += common . repeat (
986
- "\n" ,
987
- didReadContent ? 1 + emptyLines : emptyLines ,
988
- ) ;
983
+ state . result += "\n" . repeat ( didReadContent ? 1 + emptyLines : emptyLines ) ;
989
984
}
990
985
991
986
didReadContent = true ;
0 commit comments