gnodet commented on code in PR #23445:
URL: https://github.com/apache/camel/pull/23445#discussion_r3287573848
##########
core/camel-core-languages/src/main/docs/modules/languages/pages/simple-language.adoc:
##########
@@ -579,7 +579,7 @@ in the beginning and end. Suppose the message body is a
String value with `" H
The `pad` function returns a copy of the string with extra padding, if
necessary, so that its total number of characters is at least the absolute
value of the width parameter.
If width is a positive number, then the string is padded to the right; if
negative, it is padded to the left.
The optional separator specifies the padding character(s) to use. If not
specified, it defaults to the space character.
-If the message body contains `foo` then `${pad(5)}` return `"foo "` and
`${pad(-5)}` returns `" foo"`, and `${pad(-5,'@')}` returns `@@foo`.
+If the message body contains `foo` then `${pad(${body},5)}` returns `"foo "`
and `${pad(${body},-5)}` returns `" foo"`, and `${pad(${body},-5,'@')}`
returns `@@foo`.
Review Comment:
This line introduces unescaped `${body}` references that AsciiDoc interprets
as attribute lookups, causing the build failure @davsclaus flagged. The `sum`
example just above (line 472) uses `$\{body}` to escape the braces -- the same
pattern is needed here:
```suggestion
If the message body contains `foo` then `${pad($\{body},5)}` returns `"foo
"` and `${pad($\{body},-5)}` returns `" foo"`, and `${pad($\{body},-5,'@')}`
returns `@@foo`.
```
_Claude Code on behalf of Guillaume Nodet_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]