-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Replace phantomjs with playwright chromium for PDF generation to support ARM64 #1926
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
6
commits into
develop
Choose a base branch
from
copilot/fix-1925
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: Yukaii <[email protected]>
Co-authored-by: Yukaii <[email protected]>
Copilot finished work on behalf of
Yukaii
June 16, 2025 03:22
@copilot Please also update package-lock.json after npm install |
Co-authored-by: Yukaii <[email protected]>
Updated package-lock.json with Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Copilot finished work on behalf of
Yukaii
June 16, 2025 07:43
- Updated dependencies in package.json and package-lock.json to include playwright-chromium. - Modified markdown-to-pdf.js to replace Puppeteer with Playwright for PDF generation, enhancing performance and compatibility. - Adjusted launch options and page settings for Playwright. Co-authored-by: Yukaii <[email protected]> Signed-off-by: Yukai Huang <[email protected]>
- Introduced a new Mocha CLI command in package.json for easier test execution. - Expanded PDF generation tests to cover various scenarios, including handling of empty markdown and special characters. - Improved cleanup process for temporary files created during tests. - Verified module structure and dependencies in tests to ensure proper setup. Co-authored-by: Yukaii <[email protected]> Signed-off-by: Yukai Huang <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR replaces the deprecated
phantomjs
-based PDF generation with modernpuppeteer
to resolve ARM64 compatibility issues.Problem
The current PDF export functionality uses
markdown-pdf
package, which depends onphantomjs-prebuilt
. This package:Solution
Replaced the entire PDF generation pipeline with a modern
puppeteer
-based implementation:Key Changes
Dependency Update
markdown-pdf
(~9.0.0)puppeteer
(^21.0.0)New PDF Generation Utility (
lib/utils/markdown-to-pdf.js
)Updated PDF Action (
lib/note/noteActions.js
)actionPDF
to async functionAdded Tests (
test/pdf-generation.test.js
)Benefits
Testing
The implementation has been validated with:
All existing functionality is preserved while resolving the ARM64 build issue.
Fixes #1925.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/jgm/pandoc/releases/tags/3.1.11
node download.js
(http block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.