mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-20 17:15:51 +02:00
Dont split up links when extracting parameters from notes and description
This partly fixes issue #469
This commit is contained in:
parent
26a4b57cfb
commit
19819454fa
2 changed files with 2 additions and 1 deletions
|
@ -88,7 +88,7 @@ class ParameterExtractor
|
|||
protected function stringToParam(string $input, string $class): ?AbstractParameter
|
||||
{
|
||||
$input = trim($input);
|
||||
$regex = '/^(.*) *(?:=|:) *(.+)/u';
|
||||
$regex = '/^(.*) *(?:=|:)(?!\/) *(.+)/u';
|
||||
|
||||
$matches = [];
|
||||
preg_match($regex, $input, $matches);
|
||||
|
|
|
@ -67,6 +67,7 @@ class ParameterExtractorTest extends WebTestCase
|
|||
['=BC547 rewr'],
|
||||
['<i>For good</i>, [b]bad[/b], evil'],
|
||||
['Param:; Test'],
|
||||
['A [link](https://demo.part-db.de) should not be matched']
|
||||
];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue