Repalce & with & in HTML documents.

This is not a long term solution, but it's a quick fix to solve URL problems when converting to a static site via httrack.
This commit is contained in:
CalDescent 2021-07-17 19:18:22 +01:00
parent fe387931a4
commit 7a77b12834

View File

@ -78,11 +78,17 @@ public class HTMLParser {
}
}
}
return document.html().getBytes();
String html = document.html();
html = this.replaceAmpersands(html);
return html.getBytes();
}
return data;
}
private String replaceAmpersands(String html) {
return html.replace("&", "&");
}
private boolean shouldReplaceLink(String elementHtml) {
List<String> prefixes = new ArrayList<>();
prefixes.add("http"); // Don't modify absolute links