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) {
143143 }
144144 }
145145 }
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+ }
146158 }
147159
148160 private boolean isAngularTemplateAttributeName (String name ) {
@@ -153,6 +165,8 @@ private boolean isAngularTemplateAttributeName(String name) {
153165
154166 private static final Pattern ANGULAR_FOR_LOOP_DECL = Pattern .compile ("^ *let +(\\ w+) +of(?: +|(?!\\ w))(.*)" );
155167
168+ private static final Pattern VALID_ATTRIBUTE_NAME = Pattern .compile ("\\ *?\\ [?\\ (?[\\ w:_\\ -]+\\ ]?\\ )?" );
169+
156170 /** List of HTML attributes whose value is interpreted as JavaScript. */
157171 private static final Pattern JS_ATTRIBUTE =
158172 Pattern .compile (
You can’t perform that action at this time.
0 commit comments