Metadata metadata = new Metadata();
LinkContentHandler linkContentHandler = new LinkContentHandler();
new HtmlParser().parse (
new ByteArrayInputStream(test.getBytes("ISO-8859-1")),
linkContentHandler, metadata, new ParseContext());
// Expect no anchor text
assertEquals("", linkContentHandler.getLinks().get(0).getText());
// We'll change the schema to allow tables inside anchors!
Schema schema = new HTMLSchema();
schema.elementType("a", HTMLSchema.M_ANY, 65535, 0);
ParseContext parseContext = new ParseContext();
parseContext.set(Schema.class, schema);
linkContentHandler = new LinkContentHandler();
new HtmlParser().parse (
new ByteArrayInputStream(test.getBytes("ISO-8859-1")),
linkContentHandler, metadata, parseContext);