quarto-dev / quarto-dev/quarto-cli

Consider not stripping `code-line-numbers` attributes when the string syntax is used

Open
#9,920 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Opening this following discussion with @andrewpbray and @cscheid

https://github.com/quarto-dev/quarto-cli/blob/df817aeb0245e94ba30a7f50875aadeead36fd9a/src/resources/filters/quarto-pre/line-numbers.lua#L8-L22

We currently removing the attributes when a string, because we know this is only supposed to be supported by some formats.

This is like this from the start 6943aff85cb5c2d9f038d50579f4b61e2db6ddd9 so it probably has been done this way to protect

Usually we do pass along attributes in formats, so we could consider passing this one along for any HTML format.

Use case: A HTML custom format, or Quarto extension that would bring some specific feature based on the value of this attributes.

Currently it is not possible because Quarto will not pass the attributes up to the HTML output.

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 reading src/resources/filters/quarto-pre/line-numbers.lua, especially lines 8–22, and the linked discussion about the existing attribute removal. Trace how string syntax is handled for HTML output and determine whether custom HTML formats can receive the attribute. Done means the behavior is covered by an appropriate test and the requested HTML extension use case works.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
documentation, web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.