quarto-dev / quarto-dev/quarto-cli

code wrap incorrectly with line number

Open
#3,442 11 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

code-annotation code-blocks enhancement themes
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description

IDE: VScode with Quarto 1.2.269

OS: Windows 11

Description:

Suppose I create a default web project.

Then I open the code wrap and line number in configs as below:

format:
  html:
    code-line-numbers: true
    code-overflow: wrap

Then if I have a code block with a very long line, it will look bad, as shown below in the first code block:

Clipboard_20221124 (1)

I have to close the code line number to make the wrapping code overflow works, as the second code block. The problem exists in different themes and fonts too.

Checklist
  • Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.

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 with the minimal .qmd example using the shown HTML format settings, then render it to reproduce the interaction between code-line-numbers and code-overflow: wrap. Inspect the generated HTML and styling around the code block. Done means long lines wrap correctly while line numbers remain enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, html, javascript, yaml
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.