You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Hello, I'm having an issue with custom helpers. My helper is getting the name of the key unresolved, instead of the value as expected when using a certain key style.
My helper is simple:
HandleBars.registerHelper('truncate', (context, arg1) => {
if (!context) {
return `INVALID_HANDLEBARS_PLACEHOLDER`;
}
let val = context.substring(0, arg1);
return new HandleBars.SafeString(val);
});
I use this like this (and it works):
sample with MD5 hash {{{md5}}} ({{{truncate md5 6}}}...)
This however fails and just gives me the key (File.md5). So the truncation of the value fails and returns File.m instead of the shortened hash.
My json for the second is valid, and does render just fine without the truncate helper being used. I'm also not sure why quotes are required but I had to do this to get it to work:
Renders as:
The text was updated successfully, but these errors were encountered:
The issue is with the json path implementation. It's trying to access the fields as json path but fails since they are not nested json but rather keys with json path style, it should probably try the key access first?
Hello, I'm having an issue with custom helpers. My helper is getting the name of the key unresolved, instead of the value as expected when using a certain key style.
My helper is simple:
I use this like this (and it works):
This however fails and just gives me the key (File.md5). So the truncation of the value fails and returns File.m instead of the shortened hash.
My json for the second is valid, and does render just fine without the truncate helper being used. I'm also not sure why quotes are required but I had to do this to get it to work:

Renders as:

The text was updated successfully, but these errors were encountered: