未验证 提交 fdb63eae 编写于 作者: T Tim Jacomb 提交者: GitHub

JENKINS-70730 Don't remove id inside symbol (#7689)

JENKINS-70730 Don't remove id in symbol
上级 3a59e07c
......@@ -94,7 +94,6 @@ public final class Symbol {
.replaceAll("(class=\").*?(\")", "")
.replaceAll("(tooltip=\").*?(\")", "")
.replaceAll("(data-html-tooltip=\").*?(\")", "")
.replaceAll("(id=\").*?(\")", "")
.replace("stroke:#000", "stroke:currentColor");
}
......
......@@ -13,6 +13,7 @@ import java.nio.charset.StandardCharsets;
import org.apache.commons.io.IOUtils;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.jvnet.hudson.test.Issue;
public class SymbolTest {
public static final String SCIENCE_PATH;
......@@ -190,4 +191,15 @@ public class SymbolTest {
assertThat(symbol, containsString(SCIENCE_PATH));
assertThat(symbol, not(containsString("tooltip")));
}
@Test
@DisplayName("IDs in symbol should not be removed")
@Issue("JENKINS-70730")
void getSymbol_idInSymbolIsPresent() {
String symbol = Symbol.get(new SymbolRequest.Builder()
.withId("some-random-id")
.withName("with-id").build());
assertThat(symbol, containsString("id=\"a\""));
}
}
<svg
xmlns="http://www.w3.org/2000/svg"
width="82"
height="82"
viewBox="0 0 82 82"
>
<defs>
<linearGradient id="a" x1="0%" x2="102%" y1="0%" y2="101%">
<stop offset="0%" stop-color="#3023AE"/>
<stop offset="100%" stop-color="#C86DD7"/>
</linearGradient>
</defs>
<path fill="url(#a)" d="M0 0h82v82H0z"/>
</svg>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册