BUGFIX: Fixed issue generating image paths introduced in 1556c77d27

This commit is contained in:
UndefinedOffset 2016-02-24 17:30:34 -04:00
parent 6682975a09
commit ff78276f93
2 changed files with 16 additions and 2 deletions

View File

@ -108,4 +108,18 @@ class DocumentationHelper
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));
}
}

View File

@ -238,7 +238,7 @@ class DocumentationParser
}
// Rewrite URL (relative or absolute)
$baselink = Director::makeRelative(
$baselink = DocumentationHelper::relativePath(
dirname($page->getPath())
);
@ -457,7 +457,7 @@ class DocumentationParser
}
// file base link
$fileBaseLink = DocumentationHelper::normalizePath(Director::makeRelative(dirname($page->getPath())));
$fileBaseLink = DocumentationHelper::relativePath(DocumentationHelper::normalizePath(dirname($page->getPath())));
if ($matches) {
foreach ($matches[0] as $i => $match) {