From b3060b5b8202a84da05d360b4b9e7e102f9f76ad Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Tue, 15 Oct 2024 15:24:26 +0200 Subject: [PATCH] Improve links to recipes that contain Recipes? For https://github.com/openrewrite/rewrite-docs/issues/308 --- src/main/kotlin/org/openrewrite/RecipeOrigin.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/org/openrewrite/RecipeOrigin.kt b/src/main/kotlin/org/openrewrite/RecipeOrigin.kt index 003544c..3735389 100755 --- a/src/main/kotlin/org/openrewrite/RecipeOrigin.kt +++ b/src/main/kotlin/org/openrewrite/RecipeOrigin.kt @@ -20,7 +20,8 @@ class RecipeOrigin( private fun convertNameToJavaPath(recipeName: String): String = recipeName .replace('.', '/') - .replace(Regex("Recipes?\\$?.*"), "") + ".java" + .replace(Regex("\\$.*"), "") + .replace(Regex("Recipes?$"), "") + ".java" fun githubUrl(): String { return if (isFromCoreLibrary()) {