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

pl.chilldev.commons.text.formatter.MarkdownFormatter Maven / Gradle / Ivy

There is a newer version: 0.4.4
Show newest version
/**
 * This file is part of the ChillDev-Commons.
 *
 * @license http://mit-license.org/ The MIT license
 * @copyright 2016 © by Rafał Wrzeszcz - Wrzasq.pl.
 */

package pl.chilldev.commons.text.formatter;

import org.pegdown.Extensions;
import org.pegdown.PegDownProcessor;

/**
 * Markdown format handler.
 */
public class MarkdownFormatter implements FormatterInterface
{
    /**
     * Markdown processor with all available extras.
     */
    private PegDownProcessor markdownProcessor = new PegDownProcessor(Extensions.ALL);

    /**
     * {@inheritDoc}
     */
    @Override
    public String transform(String text)
    {
        return this.markdownProcessor.markdownToHtml(text);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy