From 1865738417cac31af36b5db9a40c17209fa072c0 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Wed, 16 Oct 2024 12:55:11 +0200 Subject: [PATCH] Escape standalone ampersands in xhtml InsetCitation --- src/insets/InsetCitation.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/insets/InsetCitation.cpp b/src/insets/InsetCitation.cpp index 73a17e70ff..ec3374f47f 100644 --- a/src/insets/InsetCitation.cpp +++ b/src/insets/InsetCitation.cpp @@ -663,7 +663,9 @@ docstring InsetCitation::xhtml(XMLStream & xs, OutputParams const &) const return docstring(); // have to output this raw, because generateLabel() will include tags - xs << XMLStream::ESCAPE_NONE << generateLabel(true); + // but we need to escape standalone ampersands + xs << XMLStream::ESCAPE_NONE + << subst(generateLabel(true), from_ascii(" & "), from_ascii(" & ")); return docstring(); }