Skip to content

Quotes in YAML codeblocks can escape and leak onto the page #10726

@Noxsios

Description

@Noxsios

What version of starlight are you using?

0.21.2

What version of astro are you using?

4.5.12

What package manager are you using?

npm

What operating system are you using?

Linux

What browser are you using?

Brave (Chromium)

Describe the Bug

Note sure if this is a bug in Starlight, Astro, Expressive Code or Shiki.

Seeing the following weird behavior for certain YAML codeblocks. I think something is not properly escaping " >, resulting in code getting leaked.

Screenshot 2024-04-08 at 1 13 09 PM

Screenshot 2024-04-08 at 1 12 59 PM

markdown to replicate:

broken:

```yaml
cmd: echo "foo" && echo "bar" > /tmp/hello.txt
```

working:

```yaml
# comment before causes it to work
cmd: echo "foo" && echo "bar" > /tmp/hello.txt
```

```yaml
- echo "foo" && echo "bar" > /tmp/hello.txt
```

```bash
echo "foo" && echo "bar" > /tmp/hello.txt
```

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-sdjcwl-k7jz7g?file=src%2Fcontent%2Fdocs%2Findex.mdx

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

Labels

- P4: importantViolate documented behavior or significantly impacts performance (priority)regression

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions