multiplatform-markdown-renderer icon indicating copy to clipboard operation
multiplatform-markdown-renderer copied to clipboard

Increse paragraph spacing

Open bpappin opened this issue 1 month ago • 0 comments

Feature Description

Every time i use this library, in order to improve the readability i end up increasing the block padding.

Problem Statement

The problem is that the spacing between paragraphs is very small.

Proposed Solution

increase the block padding from 2.dp to 4.dp:

Alternatives Considered

This is just adjustment to defaults as the simplest change, and some documentation for those that need the 2.dp spacing would be enough.

However, it might be better to have a separate property for paragraph spacing (spacing for newline by itself), so that you could control the spacing between a list and the text directly above it. This would have an advantage of giving the user a little more control.

Example Implementation

@Composable
fun markdownPadding(
    block: Dp = 4.dp,
    // ....
)

if adding a new property to apply to lines with only \n on them, then:

@Composable
fun markdownPadding(
    block: Dp = 2.dp,
    paragraph: Dp = 4.dp,
    // ....
)

Use Case

This is about readability of the rendered markdown, particularly when there is a large amount of text, and even more important when accessibility considerations come into play.

Additional Context

Here are some examples of the difference:

| Image | Image |

Some research on other similar renderers for non-KMP compose all have nicer formatting:

  • https://github.com/noties/Markwon
  • https://github.com/jeziellago/compose-markdown

Checklist

bpappin avatar Dec 07 '25 19:12 bpappin