Skip to content

Fix arrow highlight 14299#14370

Open
michaelwalshe wants to merge 4 commits intoquarto-dev:mainfrom
michaelwalshe:fix-arrow-highlight-14299
Open

Fix arrow highlight 14299#14370
michaelwalshe wants to merge 4 commits intoquarto-dev:mainfrom
michaelwalshe:fix-arrow-highlight-14299

Conversation

@michaelwalshe
Copy link
Copy Markdown

Description

Update arrow-light.theme to highlight BuiltIn and Extension styles rather than setting as null, applying highlighting more similarly to arrow-dark.theme and other themes. Chosen the same colour as Function style to keep arrow-light fairly minimal.

Fixes #14299

Examples

Example quarto file below which has a few different languages and some builtin & extension style types.

---
highlight-style: arrow
theme:
  light: flatly
  dark: darkly
format:
  html:
    embed-resources: true
---

```typst
#let config = (
  debug: none,
  width: auto,
  visible: true,
)

#let show-box(width: auto, border: none, fill: false) = {
  let has-border = border != none
  box(width: width, stroke: if has-border { border } else { none })
}
```

```python
import re
from statistics import mean

x = abs(-5)

y = dict(
    z = 5,
    b = 1
)

z = mean((1,2,3))

s = re.compile(r"\w{2}\d+[[:upper:]]*")
```

```terraform
locals {
  name    = trimprefix(upper("  hello-world  "), " ")
  offset  = abs(-42)
  items   = sort(["banana", "apple", "cherry"])
  joined  = join(", ", local.items)
  hash    = substr(sha256("my-id"), 0, 8)
}
```

Resulting html under old and new versions of highlighting:

test_old.html

test_new.html

Screenshot samples of differences:

Old:

Rendered HTML of markdown under oldsyntax highlighting

New:

Rendered HTML of markdown under new syntax highlighting

@cderv
Copy link
Copy Markdown
Collaborator

cderv commented Apr 17, 2026

Thanks for the fix and the clear before/after comparison.

I tested the change locally with the repro from the issue (plus axe-core via axe: true) — no new contrast violations, and the BuiltIn/Extension tokens now render distinctly from surrounding code as expected. The Function color choice keeps arrow-light's palette minimal and reuses an already a11y-vetted value, which I prefer over a larger redesign.

Contributor agreement

It looks like our PR template was removed from the PR description. One of the items it covers — also documented in CONTRIBUTING.md — is the contributor agreement. Since this is your first PR here, could you confirm you've signed an individual or corporate contributor agreement (sent to contribute@posit.co)? That's required for changes beyond small typos. If you'd rather not go through that process, no worries — let me know and I can re-implement the change on our side, crediting you in the commit.

(Note: the PDF links in our CONTRIBUTING docs are currently broken on Posit's side — I'll follow up separately to fix those. If you need the documents, let me know and I can send them to you by email.)

A note on theme parity (not blocking)

I considered whether to mirror arrow-dark's mapping (BuiltIn = Char color, Extension = Variable color + bold) more literally. In arrow-dark those are semantically distinct, but in arrow-light Variable is #111111 — effectively "don't highlight" — so mirroring would leave Extension visually indistinct from normal text. Your Function-based choice is the pragmatic fix within arrow-light's existing design. Broader light/dark consistency we can revisit separately.

@michaelwalshe
Copy link
Copy Markdown
Author

Thanks for taking a look.

Sorry for removing the template - did work through the checklist but removed as thought it was noise. On the contributor link - both of those are broken and 404 for me, so can't sign them (and not really a fan of signing an agreement for a contribution to an MIT licensed repo).

Happy for you to re-implement the change and commit yourself :)

@cderv
Copy link
Copy Markdown
Collaborator

cderv commented Apr 17, 2026

(and not really a fan of signing an agreement for a contribution to an MIT licensed repo)

yeah I am looking into that. I agree. This is leftover from when quarto was GPL at the beginning but we never removed. I'll ask around.

And I discovered broken links today - Posit has a new website and those files were lost in migration it seems.

Thanks again for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quarto default style (arrow-light) for code does not highlight dsBuiltIn and dsExtension, where arrow-dark does

2 participants