quarto-dev / quarto-dev/quarto-cli

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

Open
#12,866 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

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/

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 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.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.