File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 8
8
- Upgrade Marp Core to [ v3.9.0] ( https://github.com/marp-team/marp-core/releases/v3.9.0 ) ([ #557 ] ( https://github.com/marp-team/marp-cli/pull/557 ) )
9
9
- Upgrade dependent packages to the latest versions ([ #557 ] ( https://github.com/marp-team/marp-cli/pull/557 ) )
10
10
11
+ ### Fixed
12
+
13
+ - Enable PNG image transparency ([ #555 ] ( https://github.com/marp-team/marp-cli/issues/555 ) , [ #556 ] ( https://github.com/marp-team/marp-cli/pull/556 ) )
14
+
11
15
## v3.3.1 - 2023-10-01
12
16
13
17
### Fixed
Original file line number Diff line number Diff line change @@ -392,6 +392,13 @@ export class Converter {
392
392
await render ( )
393
393
await page . emulateMediaType ( 'print' )
394
394
395
+ if ( opts . type === ConvertType . png ) {
396
+ // Enable transparency
397
+ await page . addStyleTag ( {
398
+ content : ':root,body { background:transparent !important; }' ,
399
+ } )
400
+ }
401
+
395
402
const screenshot = async ( pageNumber = 1 ) => {
396
403
const clip = {
397
404
x : 0 ,
@@ -406,7 +413,11 @@ export class Converter {
406
413
type : 'jpeg' ,
407
414
} )
408
415
409
- return await page . screenshot ( { clip, type : 'png' } )
416
+ return await page . screenshot ( {
417
+ clip,
418
+ omitBackground : true ,
419
+ type : 'png' ,
420
+ } )
410
421
}
411
422
412
423
if ( opts . pages ) {
You can’t perform that action at this time.
0 commit comments