From 9997319c95909ed86682f113534096e80176733b Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Tue, 10 Sep 2024 12:42:15 -0700 Subject: [PATCH] Revert "Try again." This reverts commit 4717ea04f100a6fb09b802abaa7f69a87936b1e1. --- inc/Data/ThirdPartyDataFormatter.php | 2 +- src/utils/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/Data/ThirdPartyDataFormatter.php b/inc/Data/ThirdPartyDataFormatter.php index 85d2a8c..e83d1a8 100644 --- a/inc/Data/ThirdPartyDataFormatter.php +++ b/inc/Data/ThirdPartyDataFormatter.php @@ -234,7 +234,7 @@ public static function formatCode( ): string { // Conditionals. $code = preg_replace_callback( - '/{{#([^{}]+)}}(.*){{\/\1}}/', + '/{{#([^{}]+?)}}(.*){{\/\1}}/', static function ($matches) use ($args, $optionalParams) { if ((isset($args[ $matches[1] ]) && $args[ $matches[1] ]) || (isset($optionalParams[ $matches[1] ]) && $optionalParams[ $matches[1] ])) { diff --git a/src/utils/index.ts b/src/utils/index.ts index b8a6178..78ac1a2 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -62,7 +62,7 @@ export function formatCode( ) { // Conditionals. code = code.replace( - /{{#([^{}]+)}}(.*){{\/\1}}/g, + /{{#([^{}]+?)}}(.*){{\/\1}}/g, (match, name, innerCode) => { if (args?.[name] || optionalParams?.[name]) { return innerCode;