use of org.jsoup.select.NodeTraversor in project AntennaPod by AntennaPod.
the class HtmlToPlainText method getPlainText.
/**
* Format an Element to plain-text
* @param element the root element to format
* @return formatted text
*/
public String getPlainText(Element element) {
FormattingVisitor formatter = new FormattingVisitor();
NodeTraversor traversor = new NodeTraversor(formatter);
// walk the DOM, and call .head() and .tail() for each node
traversor.traverse(element);
return formatter.toString();
}
use of org.jsoup.select.NodeTraversor in project eclipse.jdt.ls by eclipse.
the class HtmlToPlainText method getPlainText.
/**
* Format an Element to plain-text
* @param element the root element to format
* @return formatted text
*/
public String getPlainText(Element element) {
FormattingVisitor formatter = new FormattingVisitor();
NodeTraversor traversor = new NodeTraversor(formatter);
// walk the DOM, and call .head() and .tail() for each node
traversor.traverse(element);
return formatter.toString();
}
Aggregations