Markdown conversion logging

pull/214/head
M66B 11 months ago
parent 7ae819f1ab
commit 547a89eede

@ -52,7 +52,12 @@ public class Markdown {
HtmlRenderer r = HtmlRenderer.builder() HtmlRenderer r = HtmlRenderer.builder()
.extensions(extensions) .extensions(extensions)
.build(); .build();
return r.render(d); String html = r.render(d);
if (BuildConfig.DEBUG) {
Log.i("Markdown md=" + markdown.replace('\n', '|'));
Log.i("Markdown html=" + markdown.replace('\n', '|'));
}
return html;
} }
static String fromHtml(String html) { static String fromHtml(String html) {
@ -63,6 +68,10 @@ public class Markdown {
String markdown = FlexmarkHtmlConverter.builder(options) String markdown = FlexmarkHtmlConverter.builder(options)
.build() .build()
.convert(html); .convert(html);
if (BuildConfig.DEBUG) {
Log.i("Markdown html=" + markdown.replace('\n', '|'));
Log.i("Markdown md=" + markdown.replace('\n', '|'));
}
return markdown return markdown
.replaceAll("(?m)^( *)(\\d+)\\.( +)", "$1$2\\\\.$3") .replaceAll("(?m)^( *)(\\d+)\\.( +)", "$1$2\\\\.$3")
.replaceAll("\n\n\\s+<!-- -->\n", ""); .replaceAll("\n\n\\s+<!-- -->\n", "");

Loading…
Cancel
Save