quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.74k stars 305 forks source link

HTML rendering automatically resizes SVG icons to the page width when embed resources is true #9171

Closed arnaudgallou closed 3 months ago

arnaudgallou commented 5 months ago

Bug description

Using multiple SVG icons with embed-resources: true resizes all icons before the last to the page width.

Using embed-resources: false solves the problem.

This is a recent bug. It worked well with the previous installed version I had which was a few month old I think.

Steps to reproduce

---
format: html
embed-resources: true
---

![](https://upload.wikimedia.org/wikipedia/commons/0/06/ORCID_iD.svg){height=20px}

![](https://upload.wikimedia.org/wikipedia/commons/0/06/ORCID_iD.svg){height=20px}

Expected behavior

No response

Actual behavior

No response

Your environment

Quarto check output

Quarto 1.4.551
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.11: OK
      Dart Sass version 1.69.5: OK
      Deno version 1.37.2: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.4.551
      Path: /Applications/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: (external install)
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/arnaudgallou/Library/TinyTeX/bin/universal-darwin
      Version: 2022

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.9.12
      Path: /usr/local/opt/python@3.9/bin/python3.9
      Jupyter: 5.7.1
      Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.3.2
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library
      knitr: 1.45
      rmarkdown: 2.26

[✓] Checking Knitr engine render......OK
mcanouil commented 5 months ago

Thanks for the report. It's a Pandoc issue you can replicate using:

text='![](https://upload.wikimedia.org/wikipedia/commons/0/06/ORCID_iD.svg){height=20px}'
echo -e "${text}\n\n${text}" > index.qmd

quarto pandoc index.qmd --from markdown --to html --embed-resources -o index.html

Could look and possibly open an issue on https://github.com/jgm/pandoc/issues?

arnaudgallou commented 5 months ago

I can't run your example. I'm getting the following error: Unknown option --embed-resources.

And running pandoc index.qmd --from markdown --to html --embed-resources -o index.html produces the right output.

mcanouil commented 5 months ago

That is not normal.

What gives you:

quarto pandoc --version

I believe there is something off in your Quarto installation.

arnaudgallou commented 5 months ago
pandoc 2.18
Compiled with pandoc-types 1.22.2, texmath 0.12.5, skylighting 0.12.3,
citeproc 0.7, ipynb 0.2, hslua 2.2.0
Scripting engine: Lua 5.4
User data directory: /Users/my_username/.local/share/pandoc
Copyright (C) 2006-2022 John MacFarlane. Web:  https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.
mcanouil commented 5 months ago

That's not normal. Quarto 1.4 uses Pandoc 3. Your installation is somehow corrupted. I suggest your uninstall completely Quarto and reinstall it.

arnaudgallou commented 5 months ago

I've just reinstalled Quarto and I can now run your example.

I see that Quarto uses Pandoc 3.1.11.

~ quarto pandoc --version
pandoc 3.1.11
Features: +server +lua
Scripting engine: Lua 5.4
User data directory: /Users/my_username/.local/share/pandoc
Copyright (C) 2006-2023 John MacFarlane. Web: https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.

The issue was actually fixed in Pandoc 3.1.12 (see https://github.com/jgm/pandoc/issues/9439 and the Text.Pandoc.SelfContained bullet in the release log https://github.com/jgm/pandoc/releases/tag/3.1.12).

cscheid commented 5 months ago

Our plan is upgrade to Pandoc >= 3.1.12 at some point in the next few weeks.

cscheid commented 3 months ago

We're now running Pandoc 3.2.