in generator/src/main/groovy/generator/DocumentationHTMLCleaner.groovy [98:110]
private static String extractTOC(final String html) {
int start = html.indexOf(TOC_START)
if (start > 0) {
int end = html.indexOf(MAIN_START)
if (end>0) {
def out = html.substring(start, end).replace("<div id=\"toctitle\">Table of Contents</div>", "")
end = out.size()-1
while (!out.substring(end, out.size()).startsWith('</div>')) end--
return out.substring(0, end)
}
}
null
}