Skip to content

Commit fc7eb78

Browse files
authored
Merge pull request #735 from marp-team/firefox-enable-context-properties
Fix incorrect page number rendering in `uncover` theme on PDF rendered by Firefox
2 parents 0b2db50 + 8a321f6 commit fc7eb78

4 files changed

Lines changed: 9 additions & 43 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
### Fixed
1313

1414
- Improve CLI boot time by loading Marpit and Puppeteer on demand ([#732](https://github.com/marp-team/marp-cli/pull/732))
15-
- `gaia` theme renders an incorrect PDF background when using Firefox browser (`--browser firefox`) on macOS ([#734](https://github.com/marp-team/marp-cli/pull/734))
15+
- Improve PDF rendering compatibility with macOS Firefox (`--browser firefox`)
16+
- Fixed: `gaia` theme renders an incorrect PDF background ([#734](https://github.com/marp-team/marp-cli/pull/734))
17+
- Fixed: `uncover` theme renders incorrect page numbers ([#735](https://github.com/marp-team/marp-cli/pull/735))
1618
- Mitigate slow PDF rendering of `gaia` theme on macOS/iOS when generated via Chrome/Chromium ([#734](https://github.com/marp-team/marp-cli/pull/734))
1719

1820
## v4.4.1 - 2026-07-04

src/browser/browsers/firefox.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ export class FirefoxBrowser extends Browser {
1414
await this.generateLaunchOptions({
1515
...opts,
1616

17+
extraPrefsFirefox: {
18+
// https://github.com/marp-team/marp-core/pull/424#discussion_r3605672166
19+
'svg.context-properties.content.enabled': true,
20+
...opts.extraPrefsFirefox,
21+
},
22+
1723
// NOTE: Currently Windows path is incompatible with Puppeteer's preparing
1824
// FIXME: CircleCI does not work custom user data directory
1925
userDataDir:

src/converter.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ export class Converter {
122122
readonly options: ConverterOption
123123

124124
private _sOffice: SOffice | undefined = undefined
125-
private _firefoxPDFConversionWarning = false
126125
private _experimentalEditablePPTXWarning = false
127126

128127
constructor(opts: ConverterOption) {
@@ -342,16 +341,6 @@ export class Converter {
342341
const ret = file.convert(this.options.output, { extension: 'pdf' })
343342

344343
// Generate PDF
345-
const browser = await this.browser
346-
347-
if (browser.kind === 'firefox' && !this._firefoxPDFConversionWarning) {
348-
this._firefoxPDFConversionWarning = true
349-
350-
warn(
351-
'Using Firefox to convert Markdown: The output may include some incompatible renderings compared to the output generated by Chrome.'
352-
)
353-
}
354-
355344
let outlineData: OutlineData | undefined
356345

357346
ret.buffer = Buffer.from(

test/converter.ts

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -931,37 +931,6 @@ describe('Converter', () => {
931931
timeout
932932
)
933933
})
934-
935-
describe('with Firefox browser', () => {
936-
it(
937-
'outputs warning about incompatibility',
938-
async () => {
939-
const warn = jest.spyOn(console, 'warn').mockImplementation()
940-
941-
await using browserManager = new BrowserManager({
942-
finders: ['firefox'],
943-
timeout,
944-
})
945-
946-
await pdfInstance({
947-
getBrowserManager: () => browserManager,
948-
output: 'test.pdf',
949-
}).convertFile(new File(onePath))
950-
951-
expect(warn).toHaveBeenCalledWith(
952-
expect.stringContaining(
953-
'The output may include some incompatible renderings'
954-
)
955-
)
956-
expect(fs.promises.writeFile).toHaveBeenCalled()
957-
958-
const [lastCall] = writeFileSpy.mock.calls.slice(-1)
959-
expect(lastCall[0]).toBe('test.pdf')
960-
expect(lastCall[1]).toBeInstanceOf(Buffer)
961-
},
962-
timeout
963-
)
964-
})
965934
})
966935

967936
describe('when convert type is PPTX', () => {

0 commit comments

Comments
 (0)