Markwon
Markwon copied to clipboard
Last paragraph has weird bottom margin
- Markwon version: 4.6.2
Using the HTML plugin when rendering mutliple paragraphs the las one has additional bottom margin. I'd expect to have all paragraphs have same margins.
class MarkwonActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val markwon = Markwon.builder(this)
.usePlugin(HtmlPlugin.create())
.build()
val html = """
<p>First paragraph</p>
<p>Second paragraph</p>
""".trimIndent()
setContentView(LinearLayout(this).apply {
orientation = LinearLayout.VERTICAL
addView(TextView(this@MarkwonActivity).apply {
text = markwon.toMarkdown(html)
setTextColor(Color.BLACK)
setBackgroundColor(Color.RED)
})
})
}
}
Given this sample I get the following results:
If I change the HTML to
val html = """
<p>First paragraph</p>
<b>Second paragraph</b>
""".trimIndent()
Then it looks like I wanted it to
I wouldn't mind this behavior but if add more spacing between paragraphs (via the LastLineSpacingSpan
) I'll end up with doubled bottom spacing for the last paragraph.