package com.feed_the_beast.ftbcurseappbot.utils;

import org.commonmark.Extension;
import org.commonmark.ext.gfm.strikethrough.StrikethroughExtension;
import org.commonmark.ext.gfm.tables.TablesExtension;
import org.commonmark.html.HtmlRenderer;
import org.commonmark.node.Node;
import org.commonmark.parser.Parser;

import java.util.Arrays;
import java.util.List;

public class CommonMarkUtils {
    private Parser parser;
    private HtmlRenderer renderer;

    public CommonMarkUtils () {
        List<Extension> extensions = Arrays.asList(TablesExtension.create(), StrikethroughExtension.create());
        parser = Parser.builder().extensions(extensions).build();
        renderer = HtmlRenderer.builder().extensions(extensions).build();

    }

    public String renderToHTML (String md) {
        Node document = parser.parse(md);
        return renderer.render(document);

    }
}

@@ -224,25 +224,17 @@
 ark.
-html.HtmlRenderer
+node.Node
 ;%0Aim
@@ -249,33 +249,37 @@
 .commonmark.
-node.Node
+parser.Parser
 ;%0Aimport org
@@ -286,35 +286,48 @@
 .commonmark.
-parser.Pars
+renderer.html.HtmlRender
 er;%0A%0Aimport 

fix changed common mark import