Skip to content

Fix double escaping of Google Scholar metadata - #15047

Merged
cderv merged 2 commits into
quarto-dev:mainfrom
jolars:fix/scholar-metadata-escaping
Oct 15, 2026
Merged

cderv merged 2 commits into
quarto-dev:mainfrom
jolars:fix/scholar-metadata-escaping

Conversation

@jolars

@jolars jolars commented Oct 14, 2026

Copy link
Copy Markdown

Description

I encountered some trouble with quarto escaping metadata fro google scholar twice. With this PR, quarto passes plain citation values to the DOM so it escapes the final attributes once.

Refs: #12452

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: Codex GPT 6.1-Sol
  • Codebase grounding: local clone
  • Human review: I have reviewed, tested, and verified the AI-generated content before submitting.

@posit-snyk-bot

posit-snyk-bot commented Oct 14, 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.

Pass plain citation values to the DOM so it escapes the final attributes
once. Preserve titles, author names, explicit citation metadata, URLs,
and nested reference values after serialization.

Refs quarto-dev#12452
@jolars
jolars force-pushed the fix/scholar-metadata-escaping branch from 2be2e9f to e8211e2 Compare October 14, 2026 08:36
Comment thread src/format/html/format-html-meta.ts
tests/utils.ts already provides the temp directory create/cleanup
pattern, so the reference test uses it instead of its own try/finally.

@cderv cderv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! I reverted only the source change and the new unit tests and the smoke-all document all fail on their assertions, then pass with the fix.

I'll push a small commit on your branch before merging, so that the test in tests/unit/scholar-metadata.test.ts uses the withTempDir() helper from tests/utils.ts instead of its own try/finally.

For the record, the   example from #12452 now shows as the literal text   in citation_title, because the CSL title is the raw markdown string (emph stays as is too). The appendix citation and BibTeX have the same problem, so this is separate from the escaping and we'll follow up on it in another PR.

@cderv
cderv merged commit b097576 into quarto-dev:main Oct 15, 2026
51 checks passed
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.

4 participants