commit 1865738417cac31af36b5db9a40c17209fa072c0
Author: Juergen Spitzmueller <sp...@lyx.org>
Date:   Wed Oct 16 12:55:11 2024 +0200

    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(" &amp; 
"));
 
        return docstring();
 }
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to