Dont split up links when extracting parameters from notes and description

This partly fixes issue #469
This commit is contained in:
Jan Böhmer 2024-01-06 15:12:04 +01:00
parent 26a4b57cfb
commit 19819454fa
2 changed files with 2 additions and 1 deletions

View file

@ -88,7 +88,7 @@ class ParameterExtractor
protected function stringToParam(string $input, string $class): ?AbstractParameter protected function stringToParam(string $input, string $class): ?AbstractParameter
{ {
$input = trim($input); $input = trim($input);
$regex = '/^(.*) *(?:=|:) *(.+)/u'; $regex = '/^(.*) *(?:=|:)(?!\/) *(.+)/u';
$matches = []; $matches = [];
preg_match($regex, $input, $matches); preg_match($regex, $input, $matches);

View file

@ -67,6 +67,7 @@ class ParameterExtractorTest extends WebTestCase
['=BC547 rewr'], ['=BC547 rewr'],
['<i>For good</i>, [b]bad[/b], evil'], ['<i>For good</i>, [b]bad[/b], evil'],
['Param:; Test'], ['Param:; Test'],
['A [link](https://demo.part-db.de) should not be matched']
]; ];
} }