Skip to content

Commit

Permalink
Try again.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixarntz committed Sep 10, 2024
1 parent 9104d7a commit 4717ea0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion inc/Data/ThirdPartyDataFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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] ])) {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4717ea0

Please sign in to comment.