Skip to content

Commit

Permalink
Fix str_replace not targeting the right array element
Browse files Browse the repository at this point in the history
  • Loading branch information
colinodell committed Feb 2, 2024
1 parent 035aea8 commit 7497619
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tests/functional/CMarkRegressionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ public static function dataProvider(): \Generator
// We can't currently render spec example 13 exactly how the upstream library does. We'll likely need to overhaul
// our rendering approach in order to fix that, so we'll use this temporary workaround for now.
if ($example['number'] === 13) {
yield \str_replace('</script></li>', "</script>\n</li>", $example);
} else {
yield $example;
$example['output'] = \str_replace('</script></li>', "</script>\n</li>", $example['output']);
}

yield $example;
}
}
}
6 changes: 3 additions & 3 deletions tests/functional/CommonMarkJSRegressionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ public static function dataProvider(): \Generator
// We can't currently render spec example 18 exactly how the upstream library does. We'll likely need to overhaul
// our rendering approach in order to fix that, so we'll use this temporary workaround for now.
if ($example['number'] === 18) {
yield \str_replace('</script></li>', "</script>\n</li>", $example);
} else {
yield $example;
$example['output'] = \str_replace('</script></li>', "</script>\n</li>", $example['output']);
}

yield $example;
}
}
}

0 comments on commit 7497619

Please sign in to comment.