mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-26 17:57:16 +00:00
Disabled Markdown set text headings
This commit is contained in:
parent
fc91acded2
commit
77bed16207
1 changed files with 6 additions and 1 deletions
|
@ -20,6 +20,8 @@ package eu.faircode.email;
|
|||
*/
|
||||
|
||||
import com.vladsch.flexmark.html2md.converter.FlexmarkHtmlConverter;
|
||||
import com.vladsch.flexmark.util.data.DataHolder;
|
||||
import com.vladsch.flexmark.util.data.MutableDataSet;
|
||||
|
||||
import org.commonmark.Extension;
|
||||
import org.commonmark.ext.gfm.strikethrough.StrikethroughExtension;
|
||||
|
@ -49,7 +51,10 @@ public class Markdown {
|
|||
|
||||
static String fromHtml(String html) {
|
||||
// https://github.com/vsch/flexmark-java/wiki/Extensions#html-to-markdown
|
||||
String markdown = FlexmarkHtmlConverter.builder()
|
||||
DataHolder options = new MutableDataSet()
|
||||
.set(FlexmarkHtmlConverter.SETEXT_HEADINGS, false)
|
||||
.toImmutable();
|
||||
String markdown = FlexmarkHtmlConverter.builder(options)
|
||||
.build()
|
||||
.convert(html);
|
||||
return markdown.replaceAll("\n\n\\s+<!-- -->\n", "");
|
||||
|
|
Loading…
Reference in a new issue