Skip to content

Commit

Permalink
Fix jaeksoft#739. HTMLCleaner does not preserve the lang attribute on…
Browse files Browse the repository at this point in the history
… DOM

serialization.
  • Loading branch information
emmanuel-keller committed Jul 1, 2014
1 parent d28863f commit 6574233
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ protected HtmlNodeAbstract<?> getDocument(String pageSource)
private DomHtmlNode getDomHtmlNode() throws ParserConfigurationException {
Document document = new DomSerializer(cleaner.getProperties(), true)
.createDOM(rootTagNode);
String lang = rootTagNode.getAttributeByName("lang");
if (lang != null)
document.getDocumentElement().setAttribute("lang", lang);
return new DomHtmlNode(document);
}

Expand Down

0 comments on commit 6574233

Please sign in to comment.