Strikethrough extension

ext-strikethrough

This module adds strikethrough functionality to Markwon via StrikethroughPlugin:

final Markwon markwon = Markwon.builder(context)
    .usePlugin(StrikethroughPlugin.create())
    .build();

This plugin registers SpanFactory for Strikethrough node, so it's possible to customize Strikethrough Span that is used in rendering:

final Markwon markwon = Markwon.builder(context)
        .usePlugin(StrikethroughPlugin.create())
        .usePlugin(new AbstractMarkwonPlugin() {
            @Override
            public void configureSpansFactory(@NonNull MarkwonSpansFactory.Builder builder) {
                builder.setFactory(Strikethrough.class, new SpanFactory() {
                    @Override
                    public Object getSpans(@NonNull MarkwonConfiguration configuration, @NonNull RenderProps props) {
                        // will use Underline span instead of Strikethrough
                        return new UnderlineSpan();
                    }
                });
            }
        })
        .build();
Last Updated: 7/16/2020, 12:14:12 PM