mirror of
https://github.com/getgrav/grav.git
synced 2026-06-25 15:29:47 +02:00
Fixed remote URLs in markdown if using subfolder setup (also with inner twig)
This commit is contained in:
@@ -100,6 +100,10 @@ class Excerpts
|
||||
if (Uri::isExternal($url) && !str_starts_with($url, $grav['base_url_absolute'])) {
|
||||
return $excerpt;
|
||||
}
|
||||
if (str_starts_with($url, '/-') && str_ends_with($url, '-/')) {
|
||||
// Twig in markdown
|
||||
return $excerpt;
|
||||
}
|
||||
|
||||
$url_parts = $this->parseUrl($url);
|
||||
|
||||
@@ -194,6 +198,10 @@ class Excerpts
|
||||
if (Uri::isExternal($url) && !str_starts_with($url, $grav['base_url_absolute'])) {
|
||||
return $excerpt;
|
||||
}
|
||||
if (str_starts_with($url, '/-') && str_ends_with($url, '-/')) {
|
||||
// Twig in markdown
|
||||
return $excerpt;
|
||||
}
|
||||
|
||||
$url_parts = $this->parseUrl($url);
|
||||
|
||||
|
||||
@@ -940,8 +940,8 @@ class Page implements PageInterface
|
||||
$content = $this->content;
|
||||
if ($keepTwig) {
|
||||
$token = [
|
||||
'/' . Utils::generateRandomString(3),
|
||||
Utils::generateRandomString(3) . '/'
|
||||
'/-' . Utils::generateRandomString(3),
|
||||
Utils::generateRandomString(3) . '-/'
|
||||
];
|
||||
// Base64 encode any twig.
|
||||
$content = preg_replace_callback(
|
||||
|
||||
Reference in New Issue
Block a user