tool-recommender-bot / markedj

JVM port of graceful markdown processor marked.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

markedj Build Status Maven Central License

JVM port of graceful markdown processor marked.js.

Usage

First, add following dependency into your pom.xml:

<dependencies>
  <dependency>
    <groupId>io.github.gitbucket</groupId>
    <artifactId>markedj</artifactId>
    <version>1.0.15</version>
  </dependency>
</dependencies>

You can easily use markedj via io.github.gitbucket.markedj.Marked:

import io.github.gitbucket.markedj.*;

String markdown = ...

// With default options
String html1 = Marked.marked(markdown);

// Specify options
Options options = new Options();
options.setSanitize(true);

String html2 = Marked.marked(markdown, options);

Options

io.github.gitbucket.markedj.Options has following properties to control Markdown conversion:

Name Default Description
gfm true Enable GitHub Flavored Markdown.
tables true Enable GFM tables. This option requires the gfm option to be true.
breaks false Enable GFM line breaks. This option requires the gfm option to be true.
sanitize false Ignore any HTML that has been input.
langPrefix "lang-" Prefix of class attribute of code block
headerPrefix "" Prefix of id attribute of header
whitelist See Options.java Whitelist of HTML tags.

About

JVM port of graceful markdown processor marked.js

License:Apache License 2.0


Languages

Language:Java 72.8%Language:HTML 27.2%