Closed kirill-d-lappo closed 4 months ago
Hi @kirill-d-lappo, Yes it's possible to define custom escaping.
The following inputs will escape backslashes \
and double quotes "
with a backslash \
:
- task: replacetokens@5
inputs:
targetFiles: manifest.yml
escapeType: custom
escapeChar: '\'
charsToEscape: '\"'
tokenPattern: custom
tokenPrefix: '${'
tokenSuffix: '}'
Due to how the custom escaping is done it's important to set the escape character as the first character in charsToEscape
.
thanks!
Does the task support escaping?
In my case I have kubernetes manifest file, where I replace values in labels.
But I have problems when value of a variable contains double quotes.
For example:
with
will result in invalid yaml file.
task version: 5