File links now properly rewrite to resources

This commit is contained in:
UndefinedOffset 2019-01-07 15:41:43 -04:00
parent d1a0589088
commit f63d2c9652
2 changed files with 3 additions and 2 deletions

View File

@ -492,6 +492,7 @@ class DocumentationParser
if (preg_match('/_images/', $url)) {
$relativeUrl = Controller::join_links(
Director::absoluteBaseURL(),
'resources',
$fileBaseLink,
$url
);

View File

@ -457,12 +457,12 @@ HTML;
$parsed = DocumentationParser::parse($this->filePage);
$this->assertContains(
DOCSVIEWER_DIR .'/tests/docs-parser/en/_images/external_link.png',
'resources/' . DOCSVIEWER_DIR .'/tests/docs-parser/en/_images/external_link.png',
$parsed
);
$this->assertContains(
DOCSVIEWER_DIR .'/tests/docs-parser/en/_images/test.tar.gz',
'resources/' . DOCSVIEWER_DIR .'/tests/docs-parser/en/_images/test.tar.gz',
$parsed
);
}