quarto-dev / quarto-dev/quarto-cli

Crossref "hover" previews behave differently for level 1 headings than for other headings

Offen
#12,866 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug crossref websites
Vorherrschende Sprache
JavaScript
Sterne
6k
Forks
458
Ø Merge
1 T. 9 Std.
Gemergte PRs (30 T.)
41

Beschreibung

I have:
  • searched the issue tracker for similar issues
  • installed the latest version of Quarto CLI
  • formatted my issue following the Bug Reports guide
Bug description

For crossrefs of level 2 and level 3 headings, the hover preview shows both the heading text itself and the first few lines of content. For level 1 heading cross-refs, the hover previews omits the heading text (and only shows the first few lines of content)

Workaround

My current workaround is to disable the "hover" behavior for cross-refs completely, via:

format:
  html:
    crossrefs-hover: false
Steps to reproduce

Have a book/website with headings pointed to by these aliases:

  • @sec-ch-language-modeling-the-basics and @sec-ch-neural-language-models-and-self-supervision points to a level 1 heading
  • @sec-attention-and-the-transformer-revolution point to a level 2 heading
  • @sec-3-statistical-language-models point to a level 3 heading
  • @sec-4-n-gram-language-models point to a level 4 heading

Then write this on any page:

- chapter crossref: (level 1 heading): @sec-ch-language-modeling-the-basics and @sec-ch-neural-language-models-and-self-supervision
- section crossref: (level 2 heading): @sec-attention-and-the-transformer-revolution
- section crossref: (level 3 heading): @sec-3-statistical-language-models
- section crossref: (level 4 heading): @sec-4-n-gram-language-models
Actual behavior

The preview for the level 1 heading crossref does not include the heading text, only the first few lines of content. This behavior is inconsistent with the behavior for other heading levels, which show both the heading text and the first few lines of content.

image showing a rendered quarto with the hover behavior activated when the user place the mouse on top of the crossref. It can be seen that the heading itself is ommitted, but the contents are shown.
Expected behavior

The expected behavior would be for the crossref preview for level 1 headings to be consistent with the other heading levels, as shown next for level 2, level 3 and level 4, respectively.

level 2 heading preview example: As expected, the heading text and the first few lines of content are shown.

Image showing the result of hovering over the crossref for a level 2 heading. As expected, the heading text and the first few lines of content are shown.

level 3 heading preview example: As expected, the heading text and the first few lines of content are shown.

Image showing the result of hovering over the crossref for a level 3 heading. As expected, the heading text and the first few lines of content are shown.

level 4 heading preview example: As expected, the heading text and the first few lines of content are shown.

Image showing the result of hovering over the crossref for a level 4 heading. As expected, the heading text and the first few lines of content are shown.
Your environment
  • IDE: VScode
  • OS: MacOS Sequoia 15.5
Quarto check output
$ quarto check
Quarto 1.7.31
[✓] Checking environment information...
      Quarto cache location: /Users/felipe.almeida/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.6.3: OK
      Dart Sass version 1.85.1: OK
      Deno version 1.46.3: OK
      Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.7.31
      Path: /Users/felipe.almeida/Applications/quarto/bin

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

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

[✓] Checking Chrome Headless....................OK
      Using: Chrome found on system
      Path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
      Source: MacOS known location

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

[✓] Checking Python 3 installation....OK
      Version: 3.9.16
      Path: /Users/felipe.almeida/.pyenv/versions/3.9.16/bin/python3
      Jupyter: 5.3.1
      Kernels: base-pyenv-venv, python3

(\) Checking Jupyter engine render....[IPKernelApp] ERROR | No such comm target registered: quarto_kernel_setup
[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Start by reproducing the issue with Quarto 1.7.31 using the listed level 1–4 heading cross-references and HTML crossref hover previews. Compare the generated previews for each heading level, then verify that level 1 previews include both the heading text and the opening content while the other levels remain unchanged.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
html, javascript
Bereich
frontend, web-dev
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.