Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5fa3b17

Browse files
committed
JS: Tolerate Angular-specific HTML attribute names
1 parent f33630a commit 5fa3b17

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

javascript/extractor/src/com/semmle/js/extractor/HTMLExtractor.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ public HTMLExtractor(ExtractorConfig config, ExtractorState state) {
144144

145145
@Override
146146
public LoCInfo extract(TextualExtractor textualExtractor) {
147+
// Angular templates contain attribute names that are not valid HTML/XML, such as [foo], (foo), [(foo)], and *foo.
148+
// Allow a large number of errors in attribute names, so the Jericho parser does not give up.
149+
Attributes.setDefaultMaxErrorCount(100);
147150
JavaScriptHTMLElementHandler eltHandler = new JavaScriptHTMLElementHandler(textualExtractor);
148151

149152
HtmlPopulator extractor =

0 commit comments

Comments
 (0)