quarto-dev / quarto-dev/quarto-cli
Crossref "hover" previews behave differently for level 1 headings than for other headings
Nobody has claimed this yet.
- 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.
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.
level 3 heading preview example: 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.
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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