Menu

#9 class Report produces invalid HTML in function addLinks

open
nobody
None
5
2010-02-10
2010-02-10
Anonymous
No

The function "addLinks" in Report class inserts stylesheet links behind HTML body tag instead of inside HTML head tag.

Line 115...124:
public String addLinks(String html, File input) {
String body = "<body";
int index = html.indexOf(body);
if (index < 0)
index = html.indexOf("<BODY");
if (index < 0)
throw new RuntimeException("Missing &lt;body&gt; in HTML file: "+input.getAbsolutePath());
int endTag = html.indexOf(">",index);
return html.substring(0,endTag+1)+reportHtml.headerLinks()+html.substring(endTag+1);
}

Discussion


Log in to post a comment.