File tree 1 file changed +6
-9
lines changed
1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -105,21 +105,18 @@ const Snippet: React.FC<SnippetProps> = ({
105
105
} , Infinity ) ;
106
106
107
107
lines . forEach ( ( line , index ) => {
108
- if ( index > 0 && lines [ index - 1 ] < line - 1 ) {
109
- includedContent . push ( omitted_placeholder ) ; // Add placeholder for omitted lines
110
- }
111
-
112
108
const rawLine = allLines [ line - 1 ] || "" ;
113
109
const trimmedLine =
114
110
rawLine . trim ( ) . length > 0 ? rawLine . slice ( minIndent ) : rawLine ;
111
+
112
+ if ( index > 0 && lines [ index - 1 ] < line - 1 ) {
113
+ // Add placeholder for omitted lines only if within range
114
+ includedContent . push ( omitted_placeholder ) ;
115
+ }
116
+
115
117
includedContent . push ( trimmedLine ) ;
116
118
} ) ;
117
119
118
- // Add placeholder if lines at the end are omitted
119
- if ( lines [ lines . length - 1 ] < allLines . length ) {
120
- includedContent . push ( omitted_placeholder ) ;
121
- }
122
-
123
120
return includedContent . join ( "\n" ) ;
124
121
} ;
125
122
You can’t perform that action at this time.
0 commit comments