mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 09:05:56 +00:00
Encode &s; in api links.
This commit is contained in:
parent
dfaa28950a
commit
6edaebab41
@ -15,7 +15,7 @@ class DocumentationParser {
|
|||||||
/**
|
/**
|
||||||
* @var string Rewriting of api links in the format "[api:MyClass]" or "[api:MyClass::$my_property]".
|
* @var string Rewriting of api links in the format "[api:MyClass]" or "[api:MyClass::$my_property]".
|
||||||
*/
|
*/
|
||||||
public static $api_link_base = 'http://api.silverstripe.org/search/lookup/?q=%s&version=%s&module=%s';
|
public static $api_link_base = 'http://api.silverstripe.org/search/lookup/?q=%s&version=%s&module=%s';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
@ -305,7 +305,7 @@ class DocumentationParser {
|
|||||||
|
|
||||||
$md = str_replace(
|
$md = str_replace(
|
||||||
$match,
|
$match,
|
||||||
sprintf('<code>[%s](%s)</code>', $title, $url),
|
sprintf('[%s](%s)', $title, $url),
|
||||||
$md
|
$md
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -325,14 +325,14 @@ class DocumentationParser {
|
|||||||
$subject = $links[1][$i];
|
$subject = $links[1][$i];
|
||||||
$url = sprintf(
|
$url = sprintf(
|
||||||
self::$api_link_base,
|
self::$api_link_base,
|
||||||
urlencode($subject),
|
$subject,
|
||||||
urlencode($page->getVersion()),
|
$page->getVersion(),
|
||||||
urlencode($page->getEntity()->getKey())
|
$page->getEntity()->getKey()
|
||||||
);
|
);
|
||||||
|
|
||||||
$md = str_replace(
|
$md = str_replace(
|
||||||
$match,
|
$match,
|
||||||
sprintf('<code>[%s](%s)</code>', $subject, $url),
|
sprintf('[%s](%s)', $subject, $url),
|
||||||
$md
|
$md
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user