Skip to content

Add code-preview-title to name code-preview iframes - #14933

Open
cwickham wants to merge 1 commit into
mainfrom
feature/code-preview-title
Open

cwickham wants to merge 1 commit into
mainfrom
feature/code-preview-title

Conversation

@cwickham

Copy link
Copy Markdown
Member

Description

Closes #14770.

The iframe from code-preview has no title, so it has no accessible name (axe-core frame-title). This PR adds a code-preview-title code block attribute. Quarto copies its value to the title of the iframe:

```{.yaml code-preview="example.qmd" code-preview-title="Example presentation with smaller text"}
format:
  revealjs:
    smaller: true
```

Without the attribute, the output does not change.

@cderv: code-preview is internal and has no documentation. Do we want a changelog entry for it? I added one under Accessibility, and I can remove it.

A follow-up quarto-web PR will add titles to the 27 previews on quarto.org.

Checklist

I have (if applicable):

  • referenced the GitHub issue this PR closes
  • updated the appropriate changelog in the PR
  • ensured the present test suite passes
  • added new tests
  • created a separate documentation PR in Quarto's website repo and linked it to this PR
AI-assisted PR
  • AI tool used: Claude Code
  • Codebase grounding: local clone
  • Human review: I have reviewed, tested, and verified the AI-generated content before submitting.

The iframe that code-preview inserts had no title, so it had no
accessible name (axe-core frame-title). The new code-preview-title
code block attribute sets it.

Fixes #14770
@posit-snyk-bot

posit-snyk-bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cwickham
cwickham marked this pull request as ready for review September 22, 2026 21:55
@cwickham
cwickham requested a review from cderv September 22, 2026 21:55
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.

Add an attribute to pass a frame title to code-preview

2 participants