@Test
    public void aTagTest() throws Exception {
        ByteArrayOutputStream buffer = new ByteArrayOutputStream();

        XHTMLContentHandler xhtml = new XHTMLContentHandler(new RichTextContentHandler(
                new OutputStreamWriter(buffer, UTF_8)), new Metadata());
        xhtml.startDocument();
        AttributesImpl attributes = new AttributesImpl();
        attributes.addAttribute("", "", "name", "", "value");
        xhtml.startElement("a", attributes);
        xhtml.endDocument();

        assertEquals("\n\n\n\n[bookmark: value]", buffer.toString(UTF_8.name()));
    }
Test to check img tags are detected and rich text version used.
tika-core/src/test/java/org/apache/tika/sax/RichTextContentHandlerTest.java