Html: extract "id" and "class" attribute names constants

This commit is contained in:
Alexander Zolotov
2014-12-15 19:36:29 +03:00
parent 374641e2df
commit b5ddb07e3b
10 changed files with 27 additions and 25 deletions

View File

@@ -98,12 +98,12 @@ class HtmlTagTreeElement extends PsiTreeElementBase<XmlTag> implements LocationP
public static String getTagPresentation(final @NotNull XmlTag tag) {
StringBuilder builder = new StringBuilder(tag.getLocalName());
String id = XmlTagTreeElement.toCanonicalForm(tag.getAttributeValue("id"));
String id = XmlTagTreeElement.toCanonicalForm(tag.getAttributeValue(HtmlUtil.ID_ATTRIBUTE_NAME));
if (id != null) {
builder.append('#').append(id);
}
String classValue = tag.getAttributeValue("class");
String classValue = tag.getAttributeValue(HtmlUtil.CLASS_ATTRIBUTE_NAME);
List<String> classValues = classValue == null ? Collections.<String>emptyList() : StringUtil.split(classValue, " ");
if (!classValues.isEmpty()) {
builder.append('.');