All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.cukedoctor.extension.CukedoctorMinMaxExtension Maven / Gradle / Ivy

There is a newer version: 3.9.0
Show newest version
package com.github.cukedoctor.extension;

import static com.github.cukedoctor.extension.CukedoctorExtensionRegistry.*;

import org.asciidoctor.ast.AbstractBlock;
import org.asciidoctor.extension.BlockMacroProcessor;

import java.util.Arrays;
import java.util.Map;

/**
 * Created by pestano on 20/07/15.
 */
public class CukedoctorMinMaxExtension extends BlockMacroProcessor {

    public CukedoctorMinMaxExtension(String name, Map config) {
        super(name, config);
    }

    @Override
    protected Object process(AbstractBlock parent, String target, Map attributes) {
        if(parent.getAttr("backend") != null && parent.getAttr("backend").toString().contains("html")) {
            StringBuilder minMax = new StringBuilder();
            minMax.append("  \n\n").
                    append("");

            return createBlock(parent, "pass", Arrays.asList(minMax.toString()), attributes,
                    this.getConfig());
        } else{
            return parent;
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy