From 834a02edc038d4e38d937936d33d0824090638ab Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 14 Feb 2024 00:02:56 +0200 Subject: [PATCH] fix markdown filters overwrite --- src/Twig/AppExtension.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Twig/AppExtension.php b/src/Twig/AppExtension.php index b957d39..1bdc799 100644 --- a/src/Twig/AppExtension.php +++ b/src/Twig/AppExtension.php @@ -193,7 +193,7 @@ class AppExtension extends AbstractExtension ): string { return preg_replace( - '~(https?://(?:www\.)?[^\(\s\)]+)~i', + '/(https?:\/\/(?:www\.)?[^\(\s\)]+)/i', '[$1]($1)', $text ); @@ -204,7 +204,7 @@ class AppExtension extends AbstractExtension ): string { return preg_replace( - '~@([A-z0-9]{64})~i', + '/@([A-f0-9]{64})/i', '[@$1](#$1)', $text ); @@ -215,7 +215,7 @@ class AppExtension extends AbstractExtension ): string { // Search not filtered namespaces - if (preg_match_all('~(N[A-z0-9]{33})~', $text, $matches)) + if (preg_match_all('/(^(?!\/)N[A-z0-9]{33})/', $text, $matches)) { if (empty($matches[1])) {