Repository navigation
Fix/citation bibtex copy button scaffold - #14387
Merged
cderv merged 4 commits intoOct 27, 2026
Merged
Conversation
In 1.8 the CSS copy-button hover selector was changed to require a div.code-copy-outer-scaffold parent. Regular code blocks were updated but the citation appendix template was not, making the copy button invisible. Wrap the bibtex <pre> in the scaffold div to match.
AJBogo9
force-pushed
the
fix/citation-bibtex-copy-button-scaffold
branch
from
May 12, 2026 17:53
6d2e847 to
0d31ab0
Compare
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
cderv
approved these changes
Oct 27, 2026
Member
There was a problem hiding this comment.
Thanks for the fix, and sorry it took a while to get to it.
I can reproduce #13669 on main: the BibTeX copy button has no icon and sits outside the block. With this PR the icon shows on hover, the button is inside the block, and copying still works.
I'll push a small commit on top before merging, so no need to push anything meanwhile.
The fix ships in 1.11 (QUARTO_VERSION and the issue milestone), so the entry moves to the Regression fixes section of changelog-1.11.md. It names v1.8.15 as the release that introduced the regression: 62c7122 added the code-copy-outer-scaffold wrapper to regular code blocks only, and the copy button icon and position CSS both key on that wrapper. The smoke-all test checks the BibTeX block and its copy button share the scaffold. It fails on main with the scaffold missing. Also removes trailing whitespace in format-html-appendix.ts.
This was referenced Oct 27, 2026
cderv
added a commit
that referenced
this pull request
Oct 27, 2026
With `code-copy: false`, the BibTeX block in the citation appendix still got a copy button, but clicking it did nothing: clipboard.js and its setup script are not emitted when code copy is off. #14387 moved the button inside the block, which made the dead button easier to notice. The appendix now adds the scaffold, the code-with-copy class and the button only when code copy is enabled, using the same resolution as the other code blocks. That resolution moves to formatHasCodeCopy() in format-html-shared.ts, next to htmlFormatFeatureDefaults(), so the minimal default stays in one place. The appendix cannot import format-html.ts without an import cycle, since that module imports the bootstrap postprocessor, which calls the appendix. - Gate the BibTeX copy button and its scaffold on code-copy - Resolve code-copy in one shared helper, not inline in format-html.ts - Stop createCodeBlock from always adding code-with-copy Fixes #15207
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In 1.8 the CSS copy-button hover selector was changed to require a
div.code-copy-outer-scaffoldparent. Regular code blocks were updated but the citation appendix template was not. The consequence was that the copy button became invisible on BibTeX citation entries. This fix wraps the BibTeX<pre>block in the scaffold div to match.Closes #13669
Checklist
I have (if applicable):