From c50ef9d29366ecb415296ade62f64979297c12fa Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Tue, 3 Dec 2024 20:40:44 +0100 Subject: [PATCH] MergeYaml example value should start on a new line Fixes https://github.com/openrewrite/rewrite/issues/4736 --- src/main/kotlin/org/openrewrite/RecipeMarkdownGenerator.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/org/openrewrite/RecipeMarkdownGenerator.kt b/src/main/kotlin/org/openrewrite/RecipeMarkdownGenerator.kt index 483113e..b00ac75 100644 --- a/src/main/kotlin/org/openrewrite/RecipeMarkdownGenerator.kt +++ b/src/main/kotlin/org/openrewrite/RecipeMarkdownGenerator.kt @@ -1321,11 +1321,13 @@ import TabItem from '@theme/TabItem'; if (!option.isRequired && option.example == null) { continue } - val ex = if (option.example != null && "String" == option.type && + val ex = if (option.example != null && option.type == "String" && (option.example.matches("^[{}\\[\\],`|=%@*!?-].*".toRegex()) || option.example.matches(".*:\\s.*".toRegex())) ) { "'" + option.example + "'" + } else if (option.example != null && option.type == "String" && option.example.contains('\n')) { + ">\n " + option.example.replace("\n", "\n ") } else if (option.type == "boolean") { "false" } else {