Add shortened URL link label stripping to PageInfo::stripTrailingUrlFromBody

- Add test cases for shortened URL link labels
This commit is contained in:
Hypolite Petovan 2020-07-17 17:16:22 -04:00
parent da50456675
commit 8de66c0274
2 changed files with 33 additions and 5 deletions

View file

@ -108,6 +108,21 @@ class PageInfoTest extends MockedTest
'body' => '[url=https://example.com]link label[/url]',
'url' => 'https://example.com',
],
'task-8797-shortened-link-label' => [
'expected' => 'content',
'body' => 'content [url=https://example.com/page]example.com/[/url]',
'url' => 'https://example.com/page',
],
'task-8797-shortened-link-label-ellipsis' => [
'expected' => 'content',
'body' => 'content [url=https://example.com/page]example.com…[/url]',
'url' => 'https://example.com/page',
],
'task-8797-shortened-link-label-dots' => [
'expected' => 'content',
'body' => 'content [url=https://example.com/page]example.com...[/url]',
'url' => 'https://example.com/page',
],
];
}