quarto-dev / quarto-cli

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

logo-alt broken when logo-href provided #10251

Open nathanj3 opened 2 months ago

nathanj3 commented 2 months ago

Bug description

I love the new inclusion of logo-alt for the sidebar, but it's not working for me for some reason. I tried removing the logo-href field but the problem persisted.

Steps to reproduce

_quarto.yml contains:

project:
  type: book

book:
  title: "Good title"

  sidebar: 
    title: "Good title"
    logo: "https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png"
    logo-alt: "this is the alt text that isn't displayed"
    logo-href: "https://google.com"

  chapters:
    - index.qmd

and index.qmd contains:

# Preface {.unnumbered}

Text goes here

Expected behavior

The sidebar logo should contain the alt text from the logo-alt field

Actual behavior

The HTML book generates, and when I inspect the logo, I get alt="" as shown here: <img src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" alt="" class="sidebar-logo py-0 d-lg-inline d-none">

Your environment

Quarto check output

Quarto 1.5.53
[>] 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.53
      Path: C:\Users\[redacted]\AppData\Local\Programs\Quarto\bin
      CodePage: 1252

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

[>] Checking LaTeX....................OK
      Using: Installation From Path
      Path: C:\texlive\2023\bin\windows
      Version: 2023

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

[>] Checking Python 3 installation....(None)

      Unable to locate an installed version of Python 3.
      Install Python 3 from https://www.python.org/downloads/

[>] Checking R installation...........OK
      Version: 4.4.1
      Path: C:/PROGRA~1/R/R-44~1.1
      LibPaths:
        - C:/Users/nathanj3/AppData/Local/R/win-library/4.4
        - C:/Program Files/R/R-4.4.1/library
      knitr: 1.46
      rmarkdown: 2.26

[>] Checking Knitr engine render......OK
nathanj3 commented 2 months ago

Possibly related to issue #6779

mcanouil commented 2 months ago

Thanks I can reproduce that logo-alt is not added properly in website project (thus book projects).

<a href="https://google.com/" class="sidebar-logo-link" data-original-href="https://google.com/">
<img src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" alt="" class="sidebar-logo py-0 d-lg-inline d-none">
</a>

I have a fix for this.

mcanouil commented 2 months ago

PR is up.

Note that the issue is totally unrelated and independent of logo-href.