不能用温情征服对方的人,用殴打也征服不了对方——契诃夫
分享一个markdown
解析框架:flexmark-java
https://github.com/vsch/flexmark-java
使用:
1 2 3 4 5 <dependency > <groupId > com.vladsch.flexmark</groupId > <artifactId > flexmark-all</artifactId > <version > 0.64.0</version > </dependency >
demo:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 package com.vladsch.flexmark.samples;import com.vladsch.flexmark.util.ast.Node;import com.vladsch.flexmark.html.HtmlRenderer;import com.vladsch.flexmark.parser.Parser;import com.vladsch.flexmark.util.data.MutableDataSet;public class BasicSample { public static void main (String[] args) { MutableDataSet options = new MutableDataSet (); Parser parser = Parser.builder(options).build(); HtmlRenderer renderer = HtmlRenderer.builder(options).build(); Node document = parser.parse("This is *Sparta*" ); String html = renderer.render(document); System.out.println(html); } }