commonmark-java
commonmark-java copied to clipboard
Internal space line is trimmed in converted plaintext
Convert markdown to plaintext using:
private fun convertMarkdownToPlaintext(markdown: String): String {
val parser = Parser.builder().build()
val document = parser.parse(markdown)
val renderer = TextContentRenderer.builder().build()
return renderer.render(document)
}
Example:
this
is
**note**
Expected behavior:
Expected plaintext:
this
is
note
Actual plaintext:
this
is
note
(Also see what the reference implementation does: https://spec.commonmark.org/dingus/)