File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 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> = ({
105105 } , Infinity ) ;
106106
107107 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-
112108 const rawLine = allLines [ line - 1 ] || "" ;
113109 const trimmedLine =
114110 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+
115117 includedContent . push ( trimmedLine ) ;
116118 } ) ;
117119
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-
123120 return includedContent . join ( "\n" ) ;
124121 } ;
125122
You can’t perform that action at this time.
0 commit comments