核心:读取文件
参考文章https://blog.csdn.net/w3045872817/article/details/78429742
这边稍微优化了下
public String get()throws Exception{
String html ="";
FileReader fr = new FileReader("E:/test.md");
BufferedReader br = new BufferedReader(fr);
String str;
while(null != (str=br.readLine())){
str+="\n";
html += str;
}
br.close();
PegDownProcessor pdp = new PegDownProcessor(Integer.MAX_VALUE);
html = pdp.markdownToHtml(html);
return html;
}