Skip to content

Commit 1d65424

Browse files
committed
replace func params
1 parent 6a6f945 commit 1d65424

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Keywords support simple functions to convert the values
103103

104104
| Func | Example | Description |
105105
|:-----|:-----|:-----|
106-
| `replace([old_string]=[new_string])` | `{latest_release\|replace(Git=Proj)}` | Simple replace. E.g. if name contains "Git" string then it will be replaced by "Proj"
106+
| `replace([old_string],[new_string])` | `{latest_release\|replace(Git,Proj)}` | Simple replace. E.g. if name contains "Git" string then it will be replaced by "Proj"
107107
| `conditional()` | `{latest_release_tag\|conditional()}` | If the value doesn't exist nothing is rendered (the default behaviour is to render the keyword)
108108
| `round([number])` | `{state\|round(2)}` | Rounds the value to number of fractional digits. Not very useful for this card I think (the KString processing code was copied from the other card so I just left this func)
109109

src/rich-string-processor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ const commandPattern = /(?<func>[a-z]+)\((?<params>[^\)]*)\)/;
4949

5050
const availableProcessors: IMap<IProcessorCtor> = {
5151
"replace": (params) => {
52-
const replaceDataChunks = params.split("=");
52+
const replaceDataChunks = params.split(",");
5353
if (replaceDataChunks.length != 2) {
54-
logError("'replace' function param has to have single equal char");
54+
logError("'replace' function param has to have two parameters");
5555
return undefined;
5656
}
5757

0 commit comments

Comments
 (0)