mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 09:05:56 +00:00
BUGFIX: Fixed issue generating image paths introduced in 1556c77d2713732cce34dc1941b627116c7c707c
This commit is contained in:
parent
6682975a09
commit
ff78276f93
@ -108,4 +108,18 @@ class DocumentationHelper
|
|||||||
|
|
||||||
return $path;
|
return $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper function to make normalized paths relative
|
||||||
|
*
|
||||||
|
* @param string
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function relativePath($path)
|
||||||
|
{
|
||||||
|
$base = self::normalizePath(Director::baseFolder());
|
||||||
|
|
||||||
|
return substr($path, strlen($base));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -238,7 +238,7 @@ class DocumentationParser
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Rewrite URL (relative or absolute)
|
// Rewrite URL (relative or absolute)
|
||||||
$baselink = Director::makeRelative(
|
$baselink = DocumentationHelper::relativePath(
|
||||||
dirname($page->getPath())
|
dirname($page->getPath())
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -457,7 +457,7 @@ class DocumentationParser
|
|||||||
}
|
}
|
||||||
|
|
||||||
// file base link
|
// file base link
|
||||||
$fileBaseLink = DocumentationHelper::normalizePath(Director::makeRelative(dirname($page->getPath())));
|
$fileBaseLink = DocumentationHelper::relativePath(DocumentationHelper::normalizePath(dirname($page->getPath())));
|
||||||
|
|
||||||
if ($matches) {
|
if ($matches) {
|
||||||
foreach ($matches[0] as $i => $match) {
|
foreach ($matches[0] as $i => $match) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user