HTML to Markdown with Java

前端 未结 5 2072
臣服心动
臣服心动 2020-12-04 06:52

is there an easy way to transform HTML into markdown with JAVA?

I am currently using the Java MarkdownJ library to transform markdown to html.

5条回答
  •  星月不相逢
    2020-12-04 07:29

    I am working on the same issue, and experimenting with a couple different techniques.

    The answer above could work. You could use the jTidy library to do the initial cleanup work and convert from HTML to XHTML. You use the XSLT stylesheet linked above.

    Unfortunately there is no library that has a one-stop function to do this in Java. You could try using the Python script html2text with Jython, but I haven't yet tried this!

提交回复
热议问题