diff --git a/src-tauri/src/template_callback.rs b/src-tauri/src/template_callback.rs index 22a69f50..b0f68e2f 100644 --- a/src-tauri/src/template_callback.rs +++ b/src-tauri/src/template_callback.rs @@ -27,6 +27,14 @@ impl PluginTemplateCallback { impl TemplateCallback for PluginTemplateCallback { async fn run(&self, fn_name: &str, args: HashMap) -> Result { + // The beta named the function `Response` but was changed in stable. + // Keep this here for a while because there's no easy way to migrate + let fn_name = if fn_name == "Response" { + "response" + } else { + fn_name + }; + let plugin_manager = self.app_handle.state::(); let function = plugin_manager .get_template_functions() diff --git a/src-web/components/core/Editor/twig/templateTags.ts b/src-web/components/core/Editor/twig/templateTags.ts index 61a91f6b..aa95e85d 100644 --- a/src-web/components/core/Editor/twig/templateTags.ts +++ b/src-web/components/core/Editor/twig/templateTags.ts @@ -81,9 +81,15 @@ function templateTags( // TODO: Search `node.tree` instead of using Regex here const inner = rawTag.replace(/^\$\{\[\s*/, '').replace(/\s*]}$/, ''); - const name = inner.match(/(\w+)[(]/)?.[1] ?? inner; - let option = options.find((v) => v.name === name); + let name = inner.match(/(\w+)[(]/)?.[1] ?? inner; + // The beta named the function `Response` but was changed in stable. + // Keep this here for a while because there's no easy way to migrate + if (name === 'Response') { + name = 'response'; + } + + let option = options.find((v) => v.name === name); if (option == null) { option = { invalid: true,