diff --git a/src/main/kotlin/org/openrewrite/RecipeMarkdownGenerator.kt b/src/main/kotlin/org/openrewrite/RecipeMarkdownGenerator.kt index 2626715..4b03679 100644 --- a/src/main/kotlin/org/openrewrite/RecipeMarkdownGenerator.kt +++ b/src/main/kotlin/org/openrewrite/RecipeMarkdownGenerator.kt @@ -27,6 +27,7 @@ import java.nio.file.StandardOpenOption import java.time.LocalDateTime import java.time.format.DateTimeFormatter import java.util.* +import java.util.stream.Collectors import kotlin.io.path.toPath import kotlin.system.exitProcess @@ -638,7 +639,11 @@ class RecipeMarkdownGenerator : Runnable { @Suppress("SENSELESS_COMPARISON") if (descriptor != null && descriptor.description != null) { appendLine() - appendLine("_${descriptor.description}_") + if (descriptor.description.contains("\n") || descriptor.description.contains("_")){ + appendLine(descriptor.description) + } else { + appendLine("_${descriptor.description}_") + } } appendLine() @@ -1137,20 +1142,6 @@ class RecipeMarkdownGenerator : Runnable { ) } - // Contributors - if (recipeDescriptor.contributors.isNotEmpty()) { - newLine() - writeln("## Contributors") - for (contributors in recipeDescriptor.contributors) { - if (contributors.email.contains("noreply")) { - writeln("* ${contributors.name}") - } else { - writeln("* [${contributors.name}](mailto:${contributors.email})") - } - } - newLine() - } - newLine() writeln( """ @@ -1163,6 +1154,21 @@ class RecipeMarkdownGenerator : Runnable { Please [contact Moderne](https://moderne.io/product) for more information about safely running the recipes on your own codebase in a private SaaS. """.trimIndent() ) + + // Contributors + if (recipeDescriptor.contributors.isNotEmpty()) { + newLine() + writeln("## Contributors") + writeln(recipeDescriptor.contributors.stream() + .map { contributor: Contributor -> + if (contributor.email.contains("noreply")) { + "* " + contributor.name + } else { + "* [" + contributor.name + "](mailto:" + contributor.email + ")" + } + }.collect(Collectors.joining(", ")) + ) + } } }