|
|
|
@ -274,7 +274,7 @@ class MarkdownEntity {
|
|
|
|
|
private array $props;
|
|
|
|
|
|
|
|
|
|
public function renderStart(): string {
|
|
|
|
|
global $REPOSITORY_CANONICAL_URL_FILES;
|
|
|
|
|
global $REPOSITORY_CANONICAL_URL_FILES, $SITE_CANONICAL_URL;
|
|
|
|
|
|
|
|
|
|
$type = $this->type;
|
|
|
|
|
switch ($type) {
|
|
|
|
@ -283,6 +283,10 @@ class MarkdownEntity {
|
|
|
|
|
if (!str_starts_with($href, "#") && !str_contains($href, "://")) {
|
|
|
|
|
$href = "$REPOSITORY_CANONICAL_URL_FILES/$href";
|
|
|
|
|
}
|
|
|
|
|
remove_prefix($href, $SITE_CANONICAL_URL);
|
|
|
|
|
if (empty($href)) {
|
|
|
|
|
$href = "/";
|
|
|
|
|
}
|
|
|
|
|
return "\n<a href=\"{$href}\">";
|
|
|
|
|
default: return "\n<$type>";
|
|
|
|
|
}
|
|
|
|
|