mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +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
|
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);
|
||||||
|
|
|
@ -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']
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue