Skip to content

Commit

Permalink
Merge pull request #741 from emmanuel-keller/1.6
Browse files Browse the repository at this point in the history
Fix #739. HTMLCleaner does not preserve the lang attribute on DOM
  • Loading branch information
emmanuel-keller committed Jul 1, 2014
2 parents 864b82f + 00ba281 commit 4170d57
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 4170d57

Please sign in to comment.