EDIT: дизайн внешних ссылок
This commit is contained in:
parent
477efebed9
commit
b5b52b100b
11
app/ThirdParty/Parsedown/MyParsedown.php
vendored
11
app/ThirdParty/Parsedown/MyParsedown.php
vendored
|
@ -25,10 +25,13 @@ class MyParsedown extends Parsedown
|
|||
$server_host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : null;
|
||||
$href_host = isset($Element['attributes']['href']) ? parse_url($Element['attributes']['href'], PHP_URL_HOST) : null;
|
||||
|
||||
// Add a list of allowed urls to the config?
|
||||
if ($server_host != $href_host) {
|
||||
$Element['attributes']['target'] = '_blank';
|
||||
$Element['attributes']['rel'] = 'noopener nofollow ugc';
|
||||
if($href_host) {
|
||||
// Add a list of allowed urls to the config?
|
||||
if ($server_host != $href_host) {
|
||||
$Element['attributes']['target'] = '_blank';
|
||||
$Element['attributes']['class'] = 'external-url';
|
||||
$Element['attributes']['rel'] = 'noopener nofollow ugc';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -204,6 +204,15 @@ blockquote {
|
|||
justify-content: center;
|
||||
}
|
||||
|
||||
.external-url:after {
|
||||
content: "🔗";
|
||||
font-family: bootstrap-icons;
|
||||
color: #eee;
|
||||
vertical-align: middle;
|
||||
font-size: 13px;
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
@media (max-width: 890px) {
|
||||
aside { display: none; }
|
||||
main { width: 100%; }
|
||||
|
|
Loading…
Reference in a new issue