File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,18 @@ public void handleElement(Element elt, HtmlPopulator.Context context) {
143
143
}
144
144
}
145
145
}
146
+
147
+ @ Override
148
+ public boolean shouldExtractAttributes (Element element ) {
149
+ Attributes attributes = element .getAttributes ();
150
+ if (attributes == null ) return false ;
151
+ for (Attribute attr : attributes ) {
152
+ if (!VALID_ATTRIBUTE_NAME .matcher (attr .getName ()).matches ()) {
153
+ return false ;
154
+ }
155
+ }
156
+ return true ;
157
+ }
146
158
}
147
159
148
160
private boolean isAngularTemplateAttributeName (String name ) {
@@ -153,6 +165,8 @@ private boolean isAngularTemplateAttributeName(String name) {
153
165
154
166
private static final Pattern ANGULAR_FOR_LOOP_DECL = Pattern .compile ("^ *let +(\\ w+) +of(?: +|(?!\\ w))(.*)" );
155
167
168
+ private static final Pattern VALID_ATTRIBUTE_NAME = Pattern .compile ("\\ *?\\ [?\\ (?[\\ w:_\\ -]+\\ ]?\\ )?" );
169
+
156
170
/** List of HTML attributes whose value is interpreted as JavaScript. */
157
171
private static final Pattern JS_ATTRIBUTE =
158
172
Pattern .compile (
You can’t perform that action at this time.
0 commit comments