diff --git a/src/main/java/io/wcm/wcm/ui/clientlibs/components/IncludeUtil.java b/src/main/java/io/wcm/wcm/ui/clientlibs/components/IncludeUtil.java index 0581798..02bcf3e 100644 --- a/src/main/java/io/wcm/wcm/ui/clientlibs/components/IncludeUtil.java +++ b/src/main/java/io/wcm/wcm/ui/clientlibs/components/IncludeUtil.java @@ -21,14 +21,13 @@ import java.lang.reflect.Array; import java.util.Collections; -import java.util.LinkedHashMap; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; import org.apache.sling.api.resource.ResourceResolver; -import org.apache.sling.xss.XSSAPI; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -114,7 +113,7 @@ else if (resourceResolver.getResource(library.getPath()) == null) { if (customAttributesArray == null) { return Collections.emptyMap(); } - Map result = new LinkedHashMap<>(); + Map result = new HashMap<>(); for (String item : customAttributesArray) { if (item != null) { int separator = item.indexOf('='); @@ -134,28 +133,4 @@ else if (resourceResolver.getResource(library.getPath()) == null) { return result; } - /** - * Builds opening HTML element with given name and attributes. - * @param elementName Element name - * @param attrs HTML attributes - * @param xssApi XSS API - * @return HTML element - */ - public static @NotNull String buildHtmlElementOpenTag(@NotNull String elementName, @NotNull Map attrs, - XSSAPI xssApi) { - StringBuilder markup = new StringBuilder(); - markup.append("<").append(elementName); - for (Map.Entry attr : attrs.entrySet()) { - markup.append(" "); - markup.append(attr.getKey()); - if (attr.getValue() != null) { - markup.append("=\""); - markup.append(xssApi.encodeForHTMLAttr(attr.getValue())); - markup.append("\""); - } - } - markup.append(">"); - return markup.toString(); - } - }