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

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

1 participant