@@ -0,0 +1,2639 @@
+package ru.noties.markwon.renderer;%0A%0Aimport android.content.Context;%0Aimport android.support.annotation.NonNull;%0Aimport android.support.annotation.Nullable;%0Aimport android.text.SpannableStringBuilder;%0Aimport android.text.Spanned;%0A%0Aimport org.commonmark.node.FencedCodeBlock;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.robolectric.RobolectricTestRunner;%0Aimport org.robolectric.annotation.Config;%0A%0Aimport ru.noties.markwon.SpannableBuilder;%0Aimport ru.noties.markwon.SpannableConfiguration;%0Aimport ru.noties.markwon.SpannableFactory;%0Aimport ru.noties.markwon.SyntaxHighlight;%0Aimport ru.noties.markwon.spans.SpannableTheme;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.mockito.ArgumentMatchers.any;%0Aimport static org.mockito.ArgumentMatchers.anyBoolean;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.when;%0A%0A@RunWith(RobolectricTestRunner.class)%0A@Config(manifest = Config.NONE)%0Apublic class SyntaxHighlightTest %7B%0A%0A    // codeSpan must be before actual highlight spans (true reverse of builder)%0A%0A    @Test%0A    public void test() %7B%0A%0A        final Object highlightSpan = new Object();%0A        final Object codeSpan = new Object();%0A%0A        final SyntaxHighlight highlight = new SyntaxHighlight() %7B%0A            @NonNull%0A            @Override%0A            public CharSequence highlight(@Nullable String info, @NonNull String code) %7B%0A                final SpannableStringBuilder builder = new SpannableStringBuilder(code);%0A                builder.setSpan(highlightSpan, 0, builder.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);%0A                return builder;%0A            %7D%0A        %7D;%0A%0A        final SpannableFactory factory = mock(SpannableFactory.class);%0A        when(factory.code(any(SpannableTheme.class), anyBoolean())).thenReturn(codeSpan);%0A%0A        final SpannableConfiguration configuration = SpannableConfiguration.builder(mock(Context.class))%0A                .syntaxHighlight(highlight)%0A                .factory(factory)%0A                .theme(mock(SpannableTheme.class))%0A                .build();%0A%0A        final SpannableBuilder builder = new SpannableBuilder();%0A%0A        final SpannableMarkdownVisitor visitor = new SpannableMarkdownVisitor(configuration, builder);%0A        final FencedCodeBlock fencedCodeBlock = new FencedCodeBlock();%0A        fencedCodeBlock.setLiteral(%22%7Bcode%7D%22);%0A%0A        visitor.visit(fencedCodeBlock);%0A%0A        final Object%5B%5D spans = builder.spannableStringBuilder().getSpans(0, builder.length(), Object.class);%0A%0A        assertEquals(2, spans.length);%0A        assertEquals(codeSpan, spans%5B0%5D);%0A        assertEquals(highlightSpan, spans%5B1%5D);%0A    %7D%0A%7D%0A

Add syntaxHighlight small test