From 6f5dd9c294988be703855706296f57cbcf1b16fb Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Tue, 27 Oct 2026 15:09:25 +0100 Subject: [PATCH 1/3] Insert appendix BibTeX citation as text, not HTML MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The BibTeX block in the HTML appendix holds the plain-text output of `pandoc -t biblatex`, but createCodeBlock assigned it to innerHTML. The HTML parser then decoded any `&` sequence forming an entity: Pandoc's `R\¬ebook` displayed as `R\¬ebook` (legacy `¬` without semicolon), `a\<b` as `a\ Date: Tue, 27 Oct 2026 15:22:17 +0100 Subject: [PATCH 2/3] Keep LF line endings in the appendix BibTeX block Pandoc writes its biblatex output with CRLF on Windows. innerHTML went through the HTML parser, which normalizes CRLF to LF; textContent keeps the carriage returns, so the rendered page had CRLF lines inside the BibTeX block and LF everywhere else. Browsers normalize again on load, so display and copy were unaffected, but the output file bytes changed. normalizeNewlines splits on the same `\r\n?|\n` set as the HTML parser, so the block's text is now byte-identical to the innerHTML result for any BibTeX without `&` entity sequences: rendering the 19 citation smoke-all fixtures with and without the change differs only in the two entity-literal titles. --- src/format/html/format-html-shared.ts | 3 ++- .../2026/10/16/citation-title/bibtex-entity-literals.qmd | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/format/html/format-html-shared.ts b/src/format/html/format-html-shared.ts index 47a3210951..c9a3774134 100644 --- a/src/format/html/format-html-shared.ts +++ b/src/format/html/format-html-shared.ts @@ -30,6 +30,7 @@ import { Document, Element } from "../../core/deno-dom.ts"; import { normalizePath } from "../../core/path.ts"; import { formatHasBootstrap } from "./format-html-info.ts"; import { HtmlFormatFeatureDefaults } from "./format-html-types.ts"; +import { normalizeNewlines } from "../../core/text.ts"; // features that are enabled by default for 'html'. setting // all of these to false will yield the minimal html output @@ -527,7 +528,7 @@ export function createCodeBlock( if (language) { codeEl.classList.add(language); } - codeEl.textContent = text; + codeEl.textContent = normalizeNewlines(text); preEl.appendChild(codeEl); return preEl; } diff --git a/tests/docs/smoke-all/2026/10/16/citation-title/bibtex-entity-literals.qmd b/tests/docs/smoke-all/2026/10/16/citation-title/bibtex-entity-literals.qmd index 287118bf98..a61520b147 100644 --- a/tests/docs/smoke-all/2026/10/16/citation-title/bibtex-entity-literals.qmd +++ b/tests/docs/smoke-all/2026/10/16/citation-title/bibtex-entity-literals.qmd @@ -10,6 +10,10 @@ _quarto: html: ensureFileRegexMatches: - ['title = \{Tags a\\&lt;b and x\\&amp;nbsp;y\}'] + # Pandoc writes CRLF on Windows; the block must keep LF line endings + - ['\r'] --- The BibTeX appendix block shows the Pandoc biblatex output as text. The title text `a<b` becomes `a\<b` in BibTeX and must not display as `a\ Date: Tue, 27 Oct 2026 15:43:24 +0100 Subject: [PATCH 3/3] Add changelog entry for #15210 --- news/changelog-1.11.md | 1 + 1 file changed, 1 insertion(+) diff --git a/news/changelog-1.11.md b/news/changelog-1.11.md index 06d62dd6e3..056cf58f4a 100644 --- a/news/changelog-1.11.md +++ b/news/changelog-1.11.md @@ -82,6 +82,7 @@ All changes included in 1.11: - ([#15128](https://github.com/quarto-dev/quarto-cli/pull/15128)): Fix Google Scholar metadata missing references with a YAML bibliography not wrapped in `---` delimiters. - ([#15131](https://github.com/quarto-dev/quarto-cli/issues/15131)): Fix the light/dark toggle appearing, with no dark styles to switch to, when the `dark` brand file holds only comments and is ignored. - ([#15207](https://github.com/quarto-dev/quarto-cli/issues/15207)): Fix the BibTeX citation in the HTML appendix showing a copy button that does nothing when `code-copy: false` is set. +- ([#15210](https://github.com/quarto-dev/quarto-cli/issues/15210)): Fix the BibTeX citation in the HTML appendix showing and copying altered text when the title contains text that looks like an HTML entity, such as `<` or `R¬ebook`. ### `pdf`