@@ -137,6 +137,46 @@ describe("stripLineNumbers", () => {
137137 const expected = "line one\nline two\nline three"
138138 expect ( stripLineNumbers ( input ) ) . toBe ( expected )
139139 } )
140+
141+ describe ( "aggressive mode" , ( ) => {
142+ it ( "should strip content with just a pipe character" , ( ) => {
143+ const input = "| line one\n| line two\n| line three"
144+ const expected = "line one\nline two\nline three"
145+ expect ( stripLineNumbers ( input , true ) ) . toBe ( expected )
146+ } )
147+
148+ it ( "should strip content with mixed formats in aggressive mode" , ( ) => {
149+ const input = "1 | line one\n| line two\n123 | line three"
150+ const expected = "line one\nline two\nline three"
151+ expect ( stripLineNumbers ( input , true ) ) . toBe ( expected )
152+ } )
153+
154+ it ( "should not strip content with pipe characters not at start in aggressive mode" , ( ) => {
155+ const input = "text | more text\nx | y"
156+ expect ( stripLineNumbers ( input , true ) ) . toBe ( input )
157+ } )
158+
159+ it ( "should handle empty content in aggressive mode" , ( ) => {
160+ expect ( stripLineNumbers ( "" , true ) ) . toBe ( "" )
161+ } )
162+
163+ it ( "should preserve padding after pipe in aggressive mode" , ( ) => {
164+ const input = "| line with extra spaces\n1 | indented content"
165+ const expected = " line with extra spaces\n indented content"
166+ expect ( stripLineNumbers ( input , true ) ) . toBe ( expected )
167+ } )
168+
169+ it ( "should preserve windows-style line endings in aggressive mode" , ( ) => {
170+ const input = "| line one\r\n| line two\r\n| line three"
171+ const expected = "line one\r\nline two\r\nline three"
172+ expect ( stripLineNumbers ( input , true ) ) . toBe ( expected )
173+ } )
174+
175+ it ( "should not affect regular content when using aggressive mode" , ( ) => {
176+ const input = "regular line\nanother line\nno pipes here"
177+ expect ( stripLineNumbers ( input , true ) ) . toBe ( input )
178+ } )
179+ } )
140180} )
141181
142182describe ( "truncateOutput" , ( ) => {
0 commit comments