HTML to Markdown with Java

前端 未结 5 2046
臣服心动
臣服心动 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:16

    if you are using WMD editor and want to get the markdown code on the server side, just use these options before loading the wmd.js script:

    wmd_options = {
            // format sent to the server.  can also be "HTML"
            output: "Markdown",
    
            // line wrapping length for lists, blockquotes, etc.
            lineLength: 40,
    
            // toolbar buttons.  Undo and redo get appended automatically.
            buttons: "bold italic | link blockquote code image | ol ul heading hr",
    
            // option to automatically add WMD to the first textarea found.
            autostart: true
        };
    

提交回复
热议问题