Skip to content
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

Failed to export local image when using gaia theme #175

Closed
AseiSugiyama opened this issue Oct 15, 2020 · 9 comments · Fixed by #176
Closed

Failed to export local image when using gaia theme #175

AseiSugiyama opened this issue Oct 15, 2020 · 9 comments · Fixed by #176
Labels
bug Something isn't working upstream Depended on upstream

Comments

@AseiSugiyama
Copy link

When I export the following markdown with marp-vscode,

---
marp: true
theme: gaia
inlineSVG: true
---

<!-- _class: lead -->
# Sample Slide

---

# Sample Slide

![bg right fit](plate.jpg)

the result is this.

image

However, when I used default theme (drop the theme: gaia line), marp for VSCode exports local image correctly.

image

Sample markdown and image are here. https://github.com/AseiSugiyama/marp_test

I guess this issue is not caused by #134 , so I opened this new issue.

@yhatt
Copy link
Member

yhatt commented Oct 16, 2020

We've confirmed reproducibility. Start finding out the root cause.

Probably marp-team/marp-cli#293 is pointing out a similar problem.

NOTE: inlineSVG is the constructer option for developer, not global directive for Marp / Marpit. Defining inlineSVG: true in front-matter is no meaning because our Marp Core is always enabling inline SVG mode.

@yhatt yhatt added the bug Something isn't working label Oct 16, 2020
@yhatt yhatt changed the title Failed to export local image when using gaia thema and inlineSVG. Failed to export local image when using gaia theme Oct 16, 2020
@yhatt
Copy link
Member

yhatt commented Oct 16, 2020

I'm guessing this bug comes from Chrome/Chromium. Marp internally converts HTML into PDF through installed Chrome.

I've confirmed there is often a broken advanced background image for inline SVG mode if printed the exported HTML to PDF through Chrome >= 85 on macOS. It happens in any theme, not limited to gaia theme.

  • Chrome 86 (Chromium r800071: latest): ❌
  • Chrome 85 (Chromium r782078): ❌
  • Chrome 84 (Chromium r768783): ✅

I'll continue working for finding out the workaround.

@AseiSugiyama
Copy link
Author

AseiSugiyama commented Oct 16, 2020

Thank you for your great work! I was able to make my work finished by exporting my slide as a HTML file and print it out as a PDF file. I'm very glad if my example files help to find the root cause of this issue.

@yhatt
Copy link
Member

yhatt commented Oct 17, 2020

Reporting details to Chromium bug tracker helps to resolve the root cause.
https://bugs.chromium.org/p/chromium/issues

I found out the exported HTML in Marp CLI with bare template can render background images correctly. We were supposed to have designed the default template (bespoke) also can convert to PDF, but probably injected scripts to control presentation might be prevented some background image rendering since Chrome 85.

We will implement to Marp CLI the fallback of using bare templatewhen running Chromium-based conversion.

yhatt added a commit to marp-team/marp-cli that referenced this issue Oct 17, 2020
Original report: marp-team/marp-vscode#175

If tried using not-printable template in Puppeteer-required conversion,
Marp CLI automatically fallbacks into bare template.
@yhatt yhatt linked a pull request Oct 19, 2020 that will close this issue
@Sahuta

This comment has been minimized.

@yhatt

This comment has been minimized.

@Sahuta

This comment has been minimized.

@yhatt

This comment has been minimized.

@Sahuta

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream Depended on upstream
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants