File tree Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -35,16 +35,35 @@ After.
35
35
expect ( result ) . toBe ( "After." ) ;
36
36
} ) ;
37
37
38
- it ( "returns all content after contributors when there is a comment template notice" , async ( ) => {
38
+ it ( "returns all content after contributors when there is a spellchecker comment template notice" , async ( ) => {
39
39
const getReadme = ( ) =>
40
40
Promise . resolve ( `# My Package
41
41
42
42
Usage.
43
43
44
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
44
45
<!-- spellchecker:enable -->
45
46
46
47
After.
47
48
49
+ <!-- You can remove this notice if you don't want it 🙂 no worries! -->
50
+ ` ) ;
51
+
52
+ const result = await readReadmeAdditional ( getReadme ) ;
53
+
54
+ expect ( result ) . toBe ( "After." ) ;
55
+ } ) ;
56
+
57
+ it ( "returns all content after contributors when there is a contributors comment template notice" , async ( ) => {
58
+ const getReadme = ( ) =>
59
+ Promise . resolve ( `# My Package
60
+
61
+ Usage.
62
+
63
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
64
+
65
+ After.
66
+
48
67
<!-- You can remove this notice if you don't want it 🙂 no worries! -->
49
68
` ) ;
50
69
Original file line number Diff line number Diff line change 1
- const indicatorAfterContributors = / < ! - - \s * s p e l l c h e c k e r : \s * e n a b l e \s * - - > / ;
1
+ const indicatorAfterAllContributors = / < ! - - \s * A L L - C O N T R I B U T O R S - L I S T : E N D \s * - - > / ;
2
+ const indicatorAfterAllContributorsSpellCheck =
3
+ / < ! - - \s * s p e l l c h e c k e r : \s * e n a b l e \s * - - > / ;
2
4
3
5
const indicatorBeforeTemplatedBy =
4
6
/ > .* T h i s p a c k a g e w a s t e m p l a t e d w i t h | < ! - - Y o u c a n r e m o v e t h i s n o t i c e / ;
@@ -9,7 +11,9 @@ export async function readReadmeAdditional(getReadme: () => Promise<string>) {
9
11
return undefined ;
10
12
}
11
13
12
- const indexAfterContributors = indicatorAfterContributors . exec ( readme ) ;
14
+ const indexAfterContributors =
15
+ indicatorAfterAllContributorsSpellCheck . exec ( readme ) ??
16
+ indicatorAfterAllContributors . exec ( readme ) ;
13
17
if ( ! indexAfterContributors ) {
14
18
return undefined ;
15
19
}
You can’t perform that action at this time.
0 commit comments