quarto-dev / quarto-cli

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

Rendering now changes relative paths to start with .\ instead of / #10964

Closed marik-ku closed 2 weeks ago

marik-ku commented 2 weeks ago

Bug description

The way Quarto renders relative paths has unexpectedly changed. This caused relative links that worked previously to stop working. I am using an image from this example https://quarto.org/docs/authoring/figures.html.

Steps to reproduce

---
title: "Relative link issue"
format: html
---

[![](elephant.png)](/my.relative.path/Elephant)

Expected behavior

The html in "inspect" was previously:

Image

Actual behavior

The html in "inspect" the path has now been changed to:

Image

Why does the render now change / to .\ and is this expected.

Your environment

IDE: RStudio 2024.06.14 R version 4.4.1 Windows 10

Quarto check output

Quarto 1.5.57
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.2.0: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.41.0: OK
      Typst version 0.11.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.5.57
      Path: C:\Program Files\RStudio\resources\app\bin\quarto\bin
      CodePage: 1252

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

[>] Checking LaTeX....................OK
      Tex:  (not detected)

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

[>] Checking Python 3 installation....OK
      Version: 3.9.13
      Path: C:/Program Files/Python39/python.exe
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with py -m pip install jupyter

[>] Checking R installation...........OK
      Version: 4.4.1
      Path: C:/PROGRA~1/R/R-44~1.1
      LibPaths:
        - C:/Users/User.Name/Desktop/gitlab_repositories/health_in_england_published/renv/library/windows/R-4.4/x86_64-w64-mingw32
        - C:/Users/User.Name/AppData/Local/R/cache/R/renv/sandbox/windows/R-4.4/x86_64-w64-mingw32/e0da0d43
      knitr: 1.42
      rmarkdown: 2.22

[>] Checking Knitr engine render......OK
cscheid commented 2 weeks ago

This is the intended behavior. In Quarto, / means "relative to the root". If you need truly absolute links in HTML, use a full URL.