mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
use jsx comments and honor className attribute (WEB-37786)
This commit is contained in:
+12
-2
@@ -45,16 +45,26 @@ public class CommentZenCodingFilter extends ZenCodingFilter {
|
||||
public String filterText(@NotNull String text, @NotNull TemplateToken token) {
|
||||
XmlTag tag = token.getXmlTag();
|
||||
if (tag != null) {
|
||||
String classAttr = tag.getAttributeValue(HtmlUtil.CLASS_ATTRIBUTE_NAME);
|
||||
String classAttr = tag.getAttributeValue(getClassAttributeName());
|
||||
String idAttr = tag.getAttributeValue(HtmlUtil.ID_ATTRIBUTE_NAME);
|
||||
if (!isNullOrEmpty(classAttr) || !isNullOrEmpty(idAttr)) {
|
||||
String commentString = buildCommentString(classAttr, idAttr);
|
||||
return text + "\n<!-- /" + commentString + " -->";
|
||||
return String.format(getCommentFormat(), text, commentString);
|
||||
}
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected String getCommentFormat() {
|
||||
return "%s\n<!-- /%s -->";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getClassAttributeName() {
|
||||
return HtmlUtil.CLASS_ATTRIBUTE_NAME;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getSuffix() {
|
||||
|
||||
Reference in New Issue
Block a user