Open HTTPS links in the online help in new window

This commit is contained in:
Peter Dell 2022-12-27 02:51:56 +01:00
parent 85b1fb08eb
commit eafc116529

View File

@ -191,7 +191,11 @@ final class HTMLWriter {
if (text == null) {
throw new IllegalArgumentException("Parameter 'text' must not be null.");
}
return "<a href=\"" + href + "\" >" + text + "</a>";
String target ="";
if (href.toLowerCase().startsWith("https://")) {
target=" target=\"_blank\"";
}
return "<a href=\"" + href + "\" "+target+">" + text + "</a>";
}
public static String getString(List<String> list) {