Skip to content

Commit

Permalink
Fixed bug there broke newlines do to block math never ended when star…
Browse files Browse the repository at this point in the history
…t and end marker was on the same line
  • Loading branch information
BenjaminHoegh committed Mar 17, 2024
1 parent 554266c commit bfbbf48
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ParsedownExtended.php
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,8 @@ protected function blockMathNotation($Line)
foreach ($this->settings['math']['block']['delimiters'] as $config) {

$leftMarker = preg_quote($config['left'], '/');
$regex = '/^(?<!\\\\)(' . $leftMarker . ')(.*)/';
$rightMarker = preg_quote($config['right'], '/');
$regex = '/^(?<!\\\\)('. $leftMarker . ')(.*?)(?=(?<!\\\\)' . $rightMarker . '|$)/';

if (preg_match($regex, $Line['text'], $matches)) {
return [
Expand Down

0 comments on commit bfbbf48

Please sign in to comment.