File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -13,13 +13,15 @@ function processFile(filePath) {
1313 const lines = contents . split ( / \n / ) ;
1414 const inputRegExp = / ^ \s + t e x t : \s * ?" ( .* ?) " / ;
1515 const outputRegExp = / ^ \s + o u t p u t : \s * ?" ( .* ?) " / ;
16+ const optionsRegExp = / ^ \s + o p t i o n s : \s * ?\{ / ;
1617 lines . forEach ( function ( line , index ) {
1718 const nextLine = lines [ index + 1 ] ;
18- if ( inputRegExp . test ( line ) && outputRegExp . test ( nextLine ) ) {
19+ const nextNextLine = lines [ index + 2 ] ;
20+ if ( inputRegExp . test ( line ) && outputRegExp . test ( nextLine ) && ! optionsRegExp . test ( nextNextLine ) ) {
1921 const inputMatch = line . match ( inputRegExp ) [ 1 ] ;
2022 // \\n => \n
2123 RESULT . input . push ( inputMatch . replace ( / \\ n / g, "\n" ) ) ;
22- } else if ( outputRegExp . test ( line ) ) {
24+ } else if ( outputRegExp . test ( line ) && ! optionsRegExp . test ( nextLine ) ) {
2325 const outputMatch = line . match ( outputRegExp ) [ 1 ] ;
2426 RESULT . output . push ( outputMatch . replace ( / \\ n / g, "\n" ) ) ;
2527 }
You can’t perform that action at this time.
0 commit comments