markedj

JVM port of graceful markdown processor marked.js

Лицензия

Лицензия

Группа

Группа

io.github.gitbucket
Идентификатор

Идентификатор

markedj
Последняя версия

Последняя версия

1.0.16
Дата

Дата

Тип

Тип

jar
Описание

Описание

markedj
JVM port of graceful markdown processor marked.js
Ссылка на сайт

Ссылка на сайт

https://github.com/gitbucket/markedj
Организация-разработчик

Организация-разработчик

GitBucket
Система контроля версий

Система контроля версий

https://github.com/gitbucket/markedj

Скачать markedj

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/io.github.gitbucket/markedj/ -->
<dependency>
    <groupId>io.github.gitbucket</groupId>
    <artifactId>markedj</artifactId>
    <version>1.0.16</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.gitbucket/markedj/
implementation 'io.github.gitbucket:markedj:1.0.16'
// https://jarcasting.com/artifacts/io.github.gitbucket/markedj/
implementation ("io.github.gitbucket:markedj:1.0.16")
'io.github.gitbucket:markedj:jar:1.0.16'
<dependency org="io.github.gitbucket" name="markedj" rev="1.0.16">
  <artifact name="markedj" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.gitbucket', module='markedj', version='1.0.16')
)
libraryDependencies += "io.github.gitbucket" % "markedj" % "1.0.16"
[io.github.gitbucket/markedj "1.0.16"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.jsoup : jsoup jar 1.10.2

provided (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.10

Модули Проекта

Данный проект не имеет модулей.

markedj build 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.16</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.

By default, markedj uses Jsoup's whitelist mechanism for HTML rendering. It restricts renderable tags, attributes and even protocols of attribute values. For example, the image url must be http:// or https:// by default. You can remove this restriction by customizing the whitelist as follows:

String html1 = Marked.marked("![alt text](/img/some-image.png \"title\")");
  // => <p><img alt=\"alt text\" title=\"title\"></p>

Options options = new Options();
options.getWhitelist().removeProtocols("img", "src", "http", "https");

String html2 = Marked.marked("![alt text](/img/some-image.png \"title\")", options);
  // => <p><img src="/img/some-image.png" alt="alt text" title="title"></p>
io.github.gitbucket

Версии библиотеки

Версия
1.0.16
1.0.15
1.0.14
1.0.13
1.0.12
1.0.11
1.0.10
1.0.9
1.0.8
1.0.7
1.0.6