quarto-dev / quarto-dev/quarto-cli
Consider not stripping `code-line-numbers` attributes when the string syntax is used
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
Opening this following discussion with @andrewpbray and @cscheid
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
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 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