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

SVG Self-contained fix insufficient in #9420 #9467

Closed
PeterSommerlad opened this issue Feb 16, 2024 · 1 comment
Closed

SVG Self-contained fix insufficient in #9420 #9467

PeterSommerlad opened this issue Feb 16, 2024 · 1 comment
Labels

Comments

@PeterSommerlad
Copy link

replaced ids are not replaced for gradients:

<path d="M 0,0 H 100 V 100 H 0 Z" style="fill:url(#radialGradient46);stroke:none" id="svg2_path48" />

should be

<path d="M 0,0 H 100 V 100 H 0 Z" style="fill:url(#svg2_radialGradient46);stroke:none" id="svg2_path48" />

See my comment on #9420 as well.

It seems this fix (#9420) was insufficient to support gradients in SVG. While clipping now works, Gradient areas are shown black in Safari denoting a problem. I'll attach a small example and experiments that I did. to demonstrate the missing things

  • A markdown file with tikz image using the filter diagram.lua Test.md
  • the output produced from pandoc as html using pandoc -s -t html --embed-resources --standalone -L diagram.lua -o Test.html Test.md
  • The intermediate pdf produced by diagram.lua that I hacked to keep it around: TestImage.pdf
  • The SVG file produced by inkscape --export-plain-svg --export-filename=./TesDirectInkscape.svg ./TestImage.pdf
  • And a html file, where I copied the SVG file of the previous step into the above Test.html where one sees that the browser now renders both correctly, so it is definitely an issue with some ids not transformed correctly by pandoc: TestBothPandocAndInkscapeSVGRendercorrectlyTogehter.html

It took me about a week to find the culprit (it worked with earlier versions somehow) and the clipping was fixed by above changes but they were insufficient for gradient shadings.

Pandoc version?

pandoc 3.1.12
Features: +server +lua
Scripting engine: Lua 5.4

@jgm
Copy link
Owner

jgm commented Feb 16, 2024

I've got a more general fix.

@jgm jgm closed this as completed in 45b6df5 Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants