@@ -125,7 +125,8 @@ public async Task ParseHeader(string html, HeaderFooterValues? headerType = null
125
125
126
126
var paragraphs = await ParseCoreAsync ( html , headerPart , headerImageLoader ,
127
127
new ParallelOptions ( ) { CancellationToken = cancellationToken } ,
128
- htmlStyles . GetParagraphStyle ( htmlStyles . DefaultStyles . HeaderStyle ) ) ;
128
+ htmlStyles . GetParagraphStyle ( htmlStyles . DefaultStyles . HeaderStyle ) )
129
+ . ConfigureAwait ( false ) ;
129
130
130
131
headerPart . Header . Append ( paragraphs ) ;
131
132
}
@@ -149,7 +150,8 @@ public async Task ParseFooter(string html, HeaderFooterValues? footerType = null
149
150
150
151
var paragraphs = await ParseCoreAsync ( html , footerPart , footerImageLoader ,
151
152
new ParallelOptions ( ) { CancellationToken = cancellationToken } ,
152
- htmlStyles . GetParagraphStyle ( htmlStyles . DefaultStyles . FooterStyle ) ) ;
153
+ htmlStyles . GetParagraphStyle ( htmlStyles . DefaultStyles . FooterStyle ) )
154
+ . ConfigureAwait ( false ) ;
153
155
154
156
footerPart . Footer . Append ( paragraphs ) ;
155
157
}
@@ -165,7 +167,8 @@ public async Task ParseBody(string html, CancellationToken cancellationToken = d
165
167
bodyImageLoader ??= new ImagePrefetcher < MainDocumentPart > ( mainPart , webRequester ) ;
166
168
var paragraphs = await ParseCoreAsync ( html , mainPart , bodyImageLoader ,
167
169
new ParallelOptions ( ) { CancellationToken = cancellationToken } ,
168
- htmlStyles . GetParagraphStyle ( htmlStyles . DefaultStyles . Paragraph ) ) ;
170
+ htmlStyles . GetParagraphStyle ( htmlStyles . DefaultStyles . Paragraph ) )
171
+ . ConfigureAwait ( false ) ;
169
172
170
173
if ( ! paragraphs . Any ( ) )
171
174
return ;
@@ -285,7 +288,7 @@ private async Task PreloadImages(AngleSharp.Dom.IDocument htmlDocument,
285
288
return ;
286
289
287
290
await imageUris . ForEachAsync (
288
- async ( img , cts ) => await imageLoader . Download ( img , cts ) ,
291
+ async ( img , cts ) => await imageLoader . Download ( img , cts ) . ConfigureAwait ( false ) ,
289
292
parallelOptions ) . ConfigureAwait ( false ) ;
290
293
}
291
294
0 commit comments