File tree 2 files changed +9
-5
lines changed
2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,14 @@ function removeIgnoredBlocks(string) {
5
5
ignoreEnabled = false ;
6
6
lines . forEach ( function ( line ) {
7
7
if ( line . indexOf ( 'styleguide:ignore:start' ) !== - 1 ) {
8
+ results . push ( '' ) ;
8
9
ignoreEnabled = true ;
9
10
} else if ( line . indexOf ( 'styleguide:ignore:end' ) !== - 1 ) {
11
+ results . push ( '' ) ;
10
12
ignoreEnabled = false ;
11
- } else if ( ! ignoreEnabled ) {
13
+ } else if ( ignoreEnabled ) {
14
+ results . push ( '' ) ;
15
+ } else {
12
16
results . push ( line ) ;
13
17
}
14
18
} ) ;
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ styleguide:ignore:end
18
18
Last line
19
19
*/
20
20
} ) ;
21
- expect ( ignoreBlock . removeIgnoredBlocks ( str ) ) . to . eql ( 'First line\nLast line' ) ;
21
+ expect ( ignoreBlock . removeIgnoredBlocks ( str ) ) . to . eql ( 'First line\n\n\n\n\ nLast line' ) ;
22
22
} ) ;
23
23
24
24
it ( 'should remove everything on the same line as tags' , function ( ) {
@@ -32,7 +32,7 @@ Ignore 2
32
32
Last line
33
33
*/
34
34
} ) ;
35
- expect ( ignoreBlock . removeIgnoredBlocks ( str ) ) . to . eql ( 'First line\nLast line' ) ;
35
+ expect ( ignoreBlock . removeIgnoredBlocks ( str ) ) . to . eql ( 'First line\n\n\n\n\ nLast line' ) ;
36
36
} ) ;
37
37
38
38
it ( 'should support multiple blocks' , function ( ) {
@@ -49,7 +49,7 @@ styleguide:ignore:end
49
49
Last line
50
50
*/
51
51
} ) ;
52
- expect ( ignoreBlock . removeIgnoredBlocks ( str ) ) . to . eql ( 'First line\nMiddle line\nLast line' ) ;
52
+ expect ( ignoreBlock . removeIgnoredBlocks ( str ) ) . to . eql ( 'First line\n\n\n\ nMiddle line\n\n\n \nLast line' ) ;
53
53
} ) ;
54
54
55
55
it ( 'should remove everything after start tag even if it is not closed' , function ( ) {
@@ -62,6 +62,6 @@ Ignore 2
62
62
Ignore 3
63
63
*/
64
64
} ) ;
65
- expect ( ignoreBlock . removeIgnoredBlocks ( str ) ) . to . eql ( 'First line' ) ;
65
+ expect ( ignoreBlock . removeIgnoredBlocks ( str ) ) . to . eql ( 'First line\n\n\n\n ' ) ;
66
66
} ) ;
67
67
} ) ;
You can’t perform that action at this time.
0 commit comments