This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 97e25ede957 Fix docs with wrapping words causing to have 
leading/ending wrapper
97e25ede957 is described below

commit 97e25ede95794ace755625e349170da66c910de5
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Sep 11 10:36:19 2024 +0200

    Fix docs with wrapping words causing to have leading/ending wrapper
---
 core/camel-main/src/main/docs/main.adoc                          | 6 +++---
 .../src/main/java/org/apache/camel/tooling/model/Strings.java    | 9 ++++++++-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/core/camel-main/src/main/docs/main.adoc 
b/core/camel-main/src/main/docs/main.adoc
index 4995d791a50..1081c568312 100644
--- a/core/camel-main/src/main/docs/main.adoc
+++ b/core/camel-main/src/main/docs/main.adoc
@@ -164,8 +164,8 @@ The camel.routecontroller supports 12 options, which are 
listed below.
 | *camel.routecontroller.include{zwsp}Routes* | Pattern for filtering routes 
to be included as supervised. The pattern is matching on route id, and endpoint 
uri for the route. Multiple patterns can be separated by comma. For example to 
include all kafka routes, you can say kafka:. And to include routes with 
specific route ids myRoute,myOtherRoute. The pattern supports wildcards and 
uses the matcher from org.apache.camel.support.PatternHelper#matchPattern. |  | 
String
 | *camel.routecontroller.initial{zwsp}Delay* | Initial delay in milli seconds 
before the route controller starts, after CamelContext has been started. |  | 
long
 | *camel.routecontroller.thread{zwsp}PoolSize* | The number of threads used by 
the route controller scheduled thread pool that are used for restarting routes. 
The pool uses 1 thread by default, but you can increase this to allow the 
controller to concurrently attempt to restart multiple routes in case more than 
one route has problems starting. | 1 | int
-| *{zwsp}camel.routecontroller.unhealthy{zwsp}OnExhausted* | Whether to mark 
the route as unhealthy (down) when all restarting attempts (backoff) have 
failed and the route is not successfully started and the route manager is 
giving up. If setting this to false will make health checks ignore this problem 
and allow to report the Camel application as UP. | true | boolean
-| *{zwsp}camel.routecontroller.unhealthy{zwsp}OnRestarting* | Whether to mark 
the route as unhealthy (down) when the route failed to initially start, and is 
being controlled for restarting (backoff). If setting this to false will make 
health checks ignore this problem and allow to report the Camel application as 
UP. | true | boolean
+| *camel.routecontroller.unhealthy{zwsp}OnExhausted* | Whether to mark the 
route as unhealthy (down) when all restarting attempts (backoff) have failed 
and the route is not successfully started and the route manager is giving up. 
If setting this to false will make health checks ignore this problem and allow 
to report the Camel application as UP. | true | boolean
+| *camel.routecontroller.unhealthy{zwsp}OnRestarting* | Whether to mark the 
route as unhealthy (down) when the route failed to initially start, and is 
being controlled for restarting (backoff). If setting this to false will make 
health checks ignore this problem and allow to report the Camel application as 
UP. | true | boolean
 |===
 
 
@@ -438,7 +438,7 @@ The camel.opentelemetry supports 5 options, which are 
listed below.
 | *camel.opentelemetry.enabled* | To enable OpenTelemetry | false | boolean
 | *camel.opentelemetry.encoding* | Sets whether the header keys need to be 
encoded (connector specific) or not. The value is a boolean. Dashes need for 
instances to be encoded for JMS property keys. | false | boolean
 | *camel.opentelemetry.exclude{zwsp}Patterns* | Adds an exclude pattern that 
will disable tracing for Camel messages that matches the pattern. Multiple 
patterns can be separated by comma. |  | String
-| *{zwsp}camel.opentelemetry.instrumentation{zwsp}Name* | A name uniquely 
identifying the instrumentation scope, such as the instrumentation library, 
package, or fully qualified class name. Must not be null. | camel | String
+| *camel.opentelemetry.instrumentation{zwsp}Name* | A name uniquely 
identifying the instrumentation scope, such as the instrumentation library, 
package, or fully qualified class name. Must not be null. | camel | String
 | *camel.opentelemetry.trace{zwsp}Processors* | Setting this to true will 
create new OpenTelemetry Spans for each Camel Processors. Use the 
excludePattern property to filter out Processors. | false | boolean
 |===
 
diff --git 
a/tooling/camel-tooling-model/src/main/java/org/apache/camel/tooling/model/Strings.java
 
b/tooling/camel-tooling-model/src/main/java/org/apache/camel/tooling/model/Strings.java
index b095f95b198..2defc016ba0 100644
--- 
a/tooling/camel-tooling-model/src/main/java/org/apache/camel/tooling/model/Strings.java
+++ 
b/tooling/camel-tooling-model/src/main/java/org/apache/camel/tooling/model/Strings.java
@@ -52,7 +52,14 @@ public final class Strings {
     public static String wrapCamelCaseWords(String option, int watermark, 
String lineSep) {
         String text = option.replaceAll("(?=[A-Z][a-z])", " ");
         text = wrapWords(text, "", lineSep, watermark, false);
-        return Character.toUpperCase(text.charAt(0)) + text.substring(1);
+        text = Character.toUpperCase(text.charAt(0)) + text.substring(1);
+        if (text.startsWith(lineSep)) {
+            text = text.substring(lineSep.length());
+        }
+        if (text.endsWith(lineSep)) {
+            text = text.substring(0, text.length() - lineSep.length());
+        }
+        return text;
     }
 
     /**

Reply via email to