tnorbye / kdoc-formatter

Reformats Kotlin KDoc comments, reflowing text and other cleanup, both via IDE plugin and command line utility
Apache License 2.0
73 stars 2 forks source link

Paragraph tag + list (stability) #63

Closed davidtorosyan closed 2 years ago

davidtorosyan commented 2 years ago

When a paragraph tag is removed, unneeded newlines in a list aren't removed.

Before

/**
 * 1. Test
 *
 * <p>2. Test
 */
fun foo() = Unit

After:

/**
 * 1. Test
 *
 * 2. Test
 */
fun foo() = Unit

After again:

/**
 * 1. Test
 * 2. Test
 */
fun foo() = Unit

When using default options on v1.5.1.

davidtorosyan commented 2 years ago

Discussed over email with @tnorbye, the underlying issue is that kdocs don't want you to have to adjacent lists: image

But actually, adding a <p> doesn't really fix that: image

I think the right thing to do here would be to collapse the list (like is being done now), which would force the user to add a separator themselves if they want one:

image

tnorbye commented 2 years ago

Implemented as David suggested above; it will now combine the lists directly. Fixed in 1.5.4

davidtorosyan commented 2 years ago

Hit another edge case, opened #69 (couldn't figure out how to reopen this issue).