Sha256: 8493a01010571561147f6ca6218de6d89c3db8ec84efc0e60f8306d4bf97b294

Contents?: true

Size: 307 Bytes

Versions: 9

Compression:

Stored size: 307 Bytes

Contents

package wordcram.text;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

class Html2Text {
	public String text(String html, String cssSelector) {
		Document doc = Jsoup.parse(html);

		if (cssSelector == null) {
			return doc.text();
		}
		else {
			return doc.select(cssSelector).text();
		}
	}
}

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ruby_wordcram-2.1.1 src/wordcram/text/Html2Text.java
ruby_wordcram-2.1.0 src/wordcram/text/Html2Text.java
ruby_wordcram-2.0.6 src/wordcram/text/Html2Text.java
ruby_wordcram-2.0.5 src/wordcram/text/Html2Text.java
ruby_wordcram-2.0.4 src/wordcram/text/Html2Text.java
ruby_wordcram-2.0.3 src/wordcram/text/Html2Text.java
ruby_wordcram-2.0.2 src/wordcram/text/Html2Text.java
ruby_wordcram-2.0.1 src/wordcram/text/Html2Text.java
ruby_wordcram-2.0.0 src/wordcram/text/Html2Text.java