Skip to content

Commit

Permalink
add support for angle brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
mozex committed Jun 28, 2024
1 parent 1ace1f1 commit 15a4030
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ $converter->getEnvironment()->addExtension(new RoutesExtension());
echo $converter->convert("[Home](route('home'))");
// Output: <p><a href="https://domain.com">Home</a></p>

echo $converter->convert("[Home](<route('home')>)");
// Output: <p><a href="https://domain.com">Home</a></p>

echo $converter->convert("[Home](route('home', absolute: false))");
// Output: <p><a href="/">Home</a></p>

Expand Down
2 changes: 1 addition & 1 deletion src/RoutesExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class RoutesExtension implements ConfigurationAwareInterface, ExtensionInterface
{
protected string $pattern = '/\[([^]]+)]\(route\((.*?)\)\)/s';
protected string $pattern = '/\[([^]]+)]\(<?route\((.*?)\)>?\)/s';

protected ConfigurationInterface $configuration;

Expand Down

0 comments on commit 15a4030

Please sign in to comment.