-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
Improve Puppeteer conversion on WSL environment #176
Conversation
Omitted userDataDir may make Windows Chrome through WSL fail executing.
// | ||
// But it causes invalid rendering in Marp's `inlineSVG` mode. So we override | ||
// `--disable-features` option to prevent disabling BGPT. | ||
const args = new Set<string>(['--disable-features=TranslateUI']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default arguments by Puppeteer is defined --disable-features=BlinkGenPropertyTrees
, but rendering of Marp's inline SVG mode requires this feature to prevent glitch. Now we've enabled BGPT forcely because PDF conversion on WSL may return empty slides.
: `data:text/html;base64,${baseFile.buffer!.toString('base64')}` | ||
const uri = await (async () => { | ||
if (tmpFile) { | ||
if (isWSL()) return `file:${await resolveWSLPath(tmpFile.path)}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Puppeteer is using Windows Chrome, so we have to resolve the file path for WSL if using tmpfile while conversion by enabling --allow-local-files
.
Recently WSL environment became to need
--no-sandbox
option to execute Windows Chrome. (for PDF / PPTX conversion through Puppeteer)I've improved the initialization of Puppeteer, to work some conversions on WSL again.
Resolves #175 and marp-team/marp-vscode#89.