Code example for TypefaceSpan

0
        } else if (tag == "code") {
            if (opening) {
                HtmlToSpannedConverter.start(output, new Code());
                HtmlToSpannedConverter.start(output, new Code());
            } else { 
                HtmlToSpannedConverter.end(output, Code.class, new TypefaceSpan("monospace"));
                HtmlToSpannedConverter.end(output, Code.class, new RelativeSizeSpan(0.75f));
            } 
        } 
    } 
 
    private void startSpan(SpannableStringBuilder text, Attributes attributes) {
        Span span = Span.fromAttributes(attributes);
 
        int len = text.length();
        text.setSpan(span, len, len, Spanned.SPAN_MARK_MARK);
    } 
 
    private void endSpan(SpannableStringBuilder text) {
        int len = text.length();
        Span span = HtmlToSpannedConverter.getLast(text, Span.class);