private List<Span> analyzeMarkup(SpanTree tree, SpanNode input, StringFieldValue text,
                                     AnnotationType beginTag, AnnotationType endTagType) {
        //we know that this node is annotated with "markup"
        String coveredText = input.getText(text.getString()).toString();
        int spanOffset = input.getFrom();
        int tagStart = -1;
        boolean endTag = false;
        List<Span> tags = new ArrayList<Span>();
        for (int i = 0; i < coveredText.length(); i++) {
            if (coveredText.charAt(i) == '<') {
                //we're in a tag
                tagStart = i;
                continue;
            }
            if (coveredText.charAt(i) == '>' && tagStart > -1) {
                Span span = new Span(spanOffset + tagStart, (i + 1) - tagStart);
                tags.add(span);
                if (endTag) {
                    tree.annotate(span, endTagType);
                } else {
                    tree.annotate(span, beginTag);
                }
                tagStart = -1;
            }
            if (tagStart > -1 && i == (tagStart + 1)) {
                if (coveredText.charAt(i) == '/') {
                    endTag = true;
                } else {
                    endTag = false;
                }
            }
        }
        return tags;
    }
NOTE: This method is provided only for completeness. It analyzes spans annotated with
&quot;markup&quot;, and splits them into several shorter spans annotated with &quot;begintag&quot;
and &quot;endtag&quot;.

@param tree       the span tree to annotate into
@param input      a SpanNode that is annotated with &quot;markup&quot;.
@param text       the text that the SpanNode covers
@param beginTag   the type to use for begintag annotations
@param endTagType the type to use for endtag annotations
@return a list of new spans to replace the input
document/src/test/java/com/yahoo/document/annotation/DocTestCase.java