From 5ca23d7866b2a692f59fa6b43690722982560c29 Mon Sep 17 00:00:00 2001 From: kwaroran Date: Thu, 11 Jul 2024 15:11:43 +0900 Subject: [PATCH] Add reverse macro --- public/scripts/macros.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/scripts/macros.js b/public/scripts/macros.js index aae0fad17..29f7baa2b 100644 --- a/public/scripts/macros.js +++ b/public/scripts/macros.js @@ -464,6 +464,7 @@ export function evaluateMacros(content, env) { content = content.replace(/{{firstIncludedMessageId}}/gi, () => String(getFirstIncludedMessageId() ?? '')); content = content.replace(/{{lastSwipeId}}/gi, () => String(getLastSwipeId() ?? '')); content = content.replace(/{{currentSwipeId}}/gi, () => String(getCurrentSwipeId() ?? '')); + content = content.replace(/{{reverse\:(.+?)}}/gi, (_, str) => str.split('').reverse().join('')) content = content.replace(/\{\{\/\/([\s\S]*?)\}\}/gm, '');