MCPcopy Create free account
hub / github.com/apache/solr / parse

Function parse

dev-tools/scripts/checkJavadocLinks.py:99–121  ·  view source on GitHub ↗
(baseURL, html)

Source from the content-addressed store, hash-verified

97 self.printed = True
98
99def parse(baseURL, html):
100 global failures
101 # look for broken unicode
102 if not reValidChar.match(html):
103 print(' WARNING: invalid characters detected in: %s' % baseURL)
104 failures = True
105 return [], []
106
107 parser = FindHyperlinks(baseURL)
108 try:
109 parser.feed(html)
110 parser.close()
111 except:
112 # TODO: Python's html.parser is now always lenient, which is no good for us: we want correct HTML in our javadocs
113 parser.printFile()
114 print(' WARNING: failed to parse %s:' % baseURL)
115 traceback.print_exc(file=sys.stdout)
116 failures = True
117 return [], []
118
119 #print ' %d links, %d anchors' % \
120 # (len(parser.links), len(parser.anchors))
121 return parser.links, parser.anchors
122
123failures = False
124

Callers 1

checkAllFunction · 0.85

Calls 4

printFileMethod · 0.95
FindHyperlinksClass · 0.85
closeMethod · 0.65
matchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…