(String html)
| 32 | |
| 33 | public class JsoupEx { |
| 34 | static Document parse(String html) { |
| 35 | try { |
| 36 | /* |
| 37 | org.jsoup.UncheckedIOException: java.io.IOException: Input is binary and unsupported |
| 38 | at org.jsoup.parser.CharacterReader.<init>(SourceFile:38) |
| 39 | at org.jsoup.parser.CharacterReader.<init>(SourceFile:43) |
| 40 | at org.jsoup.parser.TreeBuilder.initialiseParse(SourceFile:38) |
| 41 | at org.jsoup.parser.HtmlTreeBuilder.initialiseParse(SourceFile:65) |
| 42 | at org.jsoup.parser.TreeBuilder.parse(SourceFile:46) |
| 43 | at org.jsoup.parser.Parser.parse(SourceFile:107) |
| 44 | at org.jsoup.Jsoup.parse(SourceFile:58) |
| 45 | */ |
| 46 | return Jsoup.parse(html.replace("\0", "")); |
| 47 | } catch (OutOfMemoryError ex) { |
| 48 | Log.e(ex); |
| 49 | Document document = Document.createShell(""); |
| 50 | Element strong = document.createElement("strong"); |
| 51 | strong.text(Log.formatThrowable(ex)); |
| 52 | document.body().appendChild(strong); |
| 53 | return document; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | static Document parse(InputStream stream, String charset, String baseUri) throws IOException { |
| 58 | try { |
no test coverage detected