@@ -169,24 +169,38 @@ test('registers inline #', async () => {
169169} ) ;
170170
171171test ( 'keep -side notes- in the body section' , async ( ) => {
172- const header = " type(some/scope): subject"
173- const body =
174- " CI on master branch caught this:\n\n" +
175- " ```\n" +
176- " Unhandled Exception:\n" +
172+ const header = ' type(some/scope): subject' ;
173+ const body =
174+ ' CI on master branch caught this:\n\n' +
175+ ' ```\n' +
176+ ' Unhandled Exception:\n' +
177177 "System.AggregateException: One or more errors occurred. (Some problem when connecting to 'api.mycryptoapi.com/eth')\n\n" +
178- " --- End of stack trace from previous location where exception was thrown ---\n\n" +
179- " at GWallet.Backend.FSharpUtil.ReRaise (System.Exception ex) [0x00000] in /Users/runner/work/geewallet/geewallet/src/GWallet.Backend/FSharpUtil.fs:206\n" +
180- " ...\n" +
181- " ```" ;
178+ ' --- End of stack trace from previous location where exception was thrown ---\n\n' +
179+ ' at GWallet.Backend.FSharpUtil.ReRaise (System.Exception ex) [0x00000] in /Users/runner/work/geewallet/geewallet/src/GWallet.Backend/FSharpUtil.fs:206\n' +
180+ ' ...\n' +
181+ ' ```' ;
182182
183- const message = header + " \n\n" + body
183+ const message = header + ' \n\n' + body ;
184184
185185 const actual = await parse ( message ) ;
186186
187187 expect ( actual . body ) . toBe ( body ) ;
188188} ) ;
189189
190+ test ( 'allows separating -side nodes- by setting parserOpts.fieldPattern' , async ( ) => {
191+ const message =
192+ 'type(scope): subject\n\nbody text\n-authorName-\nrenovate[bot]' ;
193+ const changelogOpts = {
194+ parserOpts : {
195+ fieldPattern : / ^ - ( .* ) - $ / ,
196+ } ,
197+ } ;
198+ const actual = await parse ( message , undefined , changelogOpts . parserOpts ) ;
199+
200+ expect ( actual . body ) . toBe ( 'body text' ) ;
201+ expect ( actual ) . toHaveProperty ( 'authorName' , 'renovate[bot]' ) ;
202+ } ) ;
203+
190204test ( 'parses references leading subject' , async ( ) => {
191205 const message = '#1 some subject' ;
192206 const opts = await require ( 'conventional-changelog-angular' ) ;
0 commit comments