void (final @NotNull Project project, final @NotNull ProblemDescriptor descriptor) { PsiElement parent = descriptor.getPsiElement(); while (parent != null) { if (parent instanceof XmlTag && "font".equals(StringUtil.toLowerCase(((XmlTag)parent).getLocalName()))) { break; } parent = parent.getParent(); } if (parent == null) { return; } final String name = StringUtil.toLowerCase(((XmlTag)parent).getLocalName()); XmlTag tag = (XmlTag)parent; PsiElement[] replacePsiElements = generateContainingElements(project, name); int cnt = 0; for (PsiElement element : tag.getChildren()) { if (element instanceof XmlToken token) { IElementType type = token.getTokenType(); if (type == XmlTokenType.XML_NAME) { token.replace(replacePsiElements[cnt++]); } } } StringBuilder style = new StringBuilder(); for (XmlAttribute attribute : tag.getAttributes()) { if ("face".equals(attribute.getName())) { String value = attribute.getValue(); attribute.delete(); style.append("font-family: "); style.append(value); style.append("; "); } else if ("color".equals(attribute.getName())) { String value = attribute.getValue(); attribute.delete(); style.append("color: "); style.append(value); style.append("; "); } else if ("size".equals(attribute.getName())) { String value = attribute.getValue(); attribute.delete(); if (Holder.ourSizesMap.containsKey(value)) { style.append("font-size: "); style.append(Holder.ourSizesMap.get(value)); style.append("; "); } } } if (style.length() != 0) { boolean found = false; for (XmlAttribute attribute : tag.getAttributes()) { if (HtmlUtil.STYLE_ATTRIBUTE_NAME.equals(attribute.getName())) { found = true; attribute.setValue(attribute.getValue() + " " + style); break; } } if (!found) { tag.setAttribute(HtmlUtil.STYLE_ATTRIBUTE_NAME, style.toString()); } } }