From e68009807fe6fdd273d2b92468ec77406fb3b4ec Mon Sep 17 00:00:00 2001 From: Markus Winter Date: Thu, 6 Jun 2024 14:20:38 +0200 Subject: [PATCH] [JENKINS-73243] quote replacement string in symbol tooltips (#9347) (cherry picked from commit 5978ebe594585ea6ebff22d0e34f3b2ada70f898) --- .../java/org/jenkins/ui/symbol/Symbol.java | 20 ++++++++++++++++--- .../jenkins/ui/symbol/SymbolJenkinsTest.java | 17 ++++++++++++++++ 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/jenkins/ui/symbol/Symbol.java b/core/src/main/java/org/jenkins/ui/symbol/Symbol.java index 9973acc18da5e..0c8b3e1a8dbc4 100644 --- a/core/src/main/java/org/jenkins/ui/symbol/Symbol.java +++ b/core/src/main/java/org/jenkins/ui/symbol/Symbol.java @@ -13,6 +13,20 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Level; import java.util.logging.Logger; +<<<<<<< HEAD +======= +import java.util.regex.Matcher; +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +>>>>>>> 5978ebe594 ([JENKINS-73243] quote replacement string in symbol tooltips (#9347)) import jenkins.model.Jenkins; import org.apache.commons.io.IOUtils; @@ -55,13 +69,13 @@ public static String get(@NonNull SymbolRequest request) { .computeIfAbsent(identifier, key -> new ConcurrentHashMap<>()) .computeIfAbsent(name, key -> loadSymbol(identifier, key)); if ((tooltip != null && !tooltip.isBlank()) && (htmlTooltip == null || htmlTooltip.isBlank())) { - symbol = symbol.replaceAll("