quarto-dev / quarto-dev/quarto-cli

quarto messes up svg links

Open
#8,958 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug pandoc upstream
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description

I generated a svg with a link using plantuml:

@startuml
start
if (condition A) then (yes)
  :[[#subroutine1 Text 1]];
elseif (condition B) then (yes)
  :Text 2;
  stop
(no) elseif (condition C) then (yes)
  :Text 3;
(no) elseif (condition D) then (yes)
  :[[#subroutine-2 Text 4]];
else (nothing)
  :Text else;
endif
stop
@enduml

which generated the follwing svg diagram with 2 links to #subroutine1 and #subroutine-2.
main

I created a quarto document as

---
format:
  html:
    toc: true

title: Links in plantuml
author: Me
---


# Main Function

![ ](./main.svg)


# Subroutine1



# Subroutine 2





When I create the html with

quarto render svglinks.qmd -M embed-resources:true 

the links are changed to #svg_615cf2f8e2489f045e4e_subroutine-2 and #svg_615cf2f8e2489f045e4e_subroutine1 which, of course, breaks the links to the headers.

On the other hand, if I use rmarkdown:

rmarkdown::render("svglinks.qmd")

the generated HTML has the correct links.

Steps to reproduce

No response

Expected behavior

links in svg should be preserved as is

Actual behavior

links are being changed by adding a random suffix

Your environment

MacOS Sonoma 14.1.1 (23B81)

Quarto check output

Quarto 1.4.549 [✓] 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.549 Path: /Applications/quarto/bin

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

[✓] Checking LaTeX………………..OK Using: Installation From Path Path: /Library/TeX/texbin Version: 2023

[✓] Checking basic markdown render….OK

[✓] Checking Python 3 installation….OK Version: 3.11.5 (Conda) Path: /Users/fgruber/miniconda3/bin/python Jupyter: 5.5.0 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-arm64/Resources/library

knitr: 1.45 rmarkdown: 2.25

[✓] Checking Knitr engine render……OK

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided svglinks.qmd and main.svg, then run quarto render svglinks.qmd -M embed-resources:true and inspect the generated HTML anchors. Compare the embedded SVG links with the document headers and the output from rmarkdown; done means the PlantUML links still resolve to the intended headers after Quarto rendering.

Written by the indexing model from the issue text.

Assessment

Tech stack
markdown
Domain
cli, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.