Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

### Added

- Allow enabling [LayoutNG](https://www.chromium.org/blink/layoutng/) while PDF conversion via `CHROME_LAYOUTNG_PRINTING` env ([#469](https://github.com/marp-team/marp-cli/pull/469))

### Changed

- Upgrade Marp Core to [v3.3.1](https://github.com/marp-team/marp-core/releases/v3.3.1) ([#468](https://github.com/marp-team/marp-cli/pull/468))
Expand Down
6 changes: 6 additions & 0 deletions src/utils/puppeteer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ export const generatePuppeteerLaunchArgs = async () => {
// Enable DocumentTransition API
if (!process.env.CI) args.add('--enable-blink-features=DocumentTransition')

// LayoutNG Printing
if (process.env.CHROME_LAYOUTNG_PRINTING)
args.add(
'--enable-blink-features=LayoutNGPrinting,LayoutNGTableFragmentation'
)

// Resolve Chrome path to execute
if (executablePath === false) {
let findChromeError: Error | undefined
Expand Down
13 changes: 13 additions & 0 deletions test/utils/puppeteer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,19 @@ describe('#generatePuppeteerLaunchArgs', () => {
}
})

it('enables LayoutNGPrinting and LayoutNGTableFragmentation if defined CHROME_LAYOUTNG_PRINTING environment value', async () => {
try {
process.env.CHROME_LAYOUTNG_PRINTING = '1'

const args = await puppeteerUtils().generatePuppeteerLaunchArgs()
expect(args.args).toContain(
'--enable-blink-features=LayoutNGPrinting,LayoutNGTableFragmentation'
)
} finally {
delete process.env.CHROME_LAYOUTNG_PRINTING
}
})

describe('with CHROME_PATH env in macOS', () => {
let originalPlatform: string | undefined

Expand Down