From b9639102ed9ce548b32a9a66c30d7ffc8c2a7f01 Mon Sep 17 00:00:00 2001 From: James Ward Date: Thu, 25 Jul 2024 20:46:43 -0600 Subject: [PATCH] more fuzzy matching on error modications - fixes #438 --- src/main/scala/mdoc/ErrorMessageManipulation.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/scala/mdoc/ErrorMessageManipulation.scala b/src/main/scala/mdoc/ErrorMessageManipulation.scala index 5d76cdbb..26d0bab4 100644 --- a/src/main/scala/mdoc/ErrorMessageManipulation.scala +++ b/src/main/scala/mdoc/ErrorMessageManipulation.scala @@ -64,6 +64,7 @@ object ErrorMessageManipulation { .mkString("\n") .replace("java.lang.Exception", "Exception") .replace("Result: Defect: Exception:", "Defect:") + .replace("error: ", "error:") // dunno why on some there is a trailing space .replace(effectCantFailMsg, effectCantFailMsgSimple) .replace(canOnlyCallRunOnZiosMsg, canOnlyCallRunOnZiosMsgSimple) .replace( @@ -79,6 +80,8 @@ object ErrorMessageManipulation { "Please provide a layer for the following type", "Please provide a layer for" ) + + val pattern = Pattern.compile("─────────────────────────────(.*?)```", Pattern.DOTALL) val matcher = pattern.matcher(almostClean) matcher.replaceAll("─────────────────────────────\n```")