Skip to content

Commit

Permalink
Cleanup: Remove some dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
jdpanderson committed Jun 20, 2023
1 parent 548ea01 commit 15df427
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/CommonMark/Preprocessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,6 @@ public function __invoke(string $markdown): string
$markdown = $this->handleDirective($markdown, $regex, fn (string $directive) => [$this, $handler]($directive));
}
return $markdown;
$cursor = new Cursor($markdown);

$preparsed = $cursor->getPreviousText();
while ($include = $cursor->match(self::REGEX_INCLUDE)) {
$matchLen = mb_strlen($include, 'UTF-8');
$preparsed .= mb_substr($cursor->getPreviousText(), 0, -$matchLen);

$quote1 = mb_strpos($include, '"');
$quote2 = mb_strrpos($include, '"');
$args = array_map('trim', explode(",", mb_substr($include, $quote2 + 1)));
$preparsed .= $this->fetch(mb_substr($include, $quote1 + 1, $quote2 - $quote1 - 1), $args);
}
$preparsed .= $cursor->getRemainder();

return $preparsed;
}

/**
Expand Down

0 comments on commit 15df427

Please sign in to comment.