quarto-dev / quarto-dev/quarto-cli

spacing adjusted for active section

Open
#9,451 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Bug description

Certain headings see their position changed because leading whitespace is added/removed when they are active/inactive.

Steps to reproduce

Given the Quarto project:

project:
  type: website

website:
  title: "headings"
  navbar:
    left:
      - text: "Home"
        href: "index.qmd"

And an index.qmd file:

---
title: home
---

this is home.

## Level two

You may learn more.

### Level three

You may not learn more.

Preview this site, then click on the anchor icon for "Level three". Observe that the position of the heading changes.

Expected behavior

The heading position should be constant.

Actual behavior

The heading position changes.

Position before clicking "Level three" link:

image

Position after clicking the "Level three" link:

image
Your environment

No response

Quarto check output
Quarto 1.4.551
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.11: OK
      Dart Sass version 1.69.5: OK
      Deno version 1.37.2: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.4.551
      Path: /Users/aron/quarto/quarto-1.4.551-macos/bin

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

[✓] Checking LaTeX....................OK
      Using: Installation From Path
      Path: /Library/TeX/texbin
      Version: 2024

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

[✓] Checking Python 3 installation....OK
      Version: 3.12.2
      Path: /opt/homebrew/opt/python@3.12/bin/python3.12
      Jupyter: (None)

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

[✓] Checking R installation...........OK
      Version: 4.3.3
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library
      knitr: 1.45
      rmarkdown: 2.26

[✓] Checking Knitr engine render......OK

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 the minimal Quarto website and index.qmd shown in the report, then inspect the generated website's heading and anchor behavior before and after clicking the Level three link. Done means the heading position remains constant when its anchor is activated.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.