Differential D25084 Diff 371 src/infrastructure/markup/markuprule/PhutilRemarkupDocumentLinkRule.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/markup/markuprule/PhutilRemarkupDocumentLinkRule.php
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | protected function renderHyperlink($link, $name) { | ||||
if ($engine->getState('toc')) { | if ($engine->getState('toc')) { | ||||
return $name; | return $name; | ||||
} | } | ||||
$same_window = $engine->getConfig('uri.same-window', null); | $same_window = $engine->getConfig('uri.same-window', null); | ||||
if ($same_window === null) { | if ($same_window === null) { | ||||
// TODO: | |||||
// Instead of assuming every link as external, | // Instead of assuming every link as external, | ||||
// assume that only external links should be opened | // assume that only external links should be opened | ||||
// externally. This still probably creates lot of | // externally. This still probably creates lot of | ||||
// external links than needed, but less than before. | // external links than needed, but less than before. | ||||
// https://we.phorge.it/T15161 | // https://we.phorge.it/T15161 | ||||
// $same_window = $this->isInternalGenericURI($link); | $same_window = $this->isInternalGenericURI($link); | ||||
$same_window = false; | |||||
} | } | ||||
if ($same_window) { | if ($same_window) { | ||||
$target = null; | $target = null; | ||||
} else { | } else { | ||||
$target = '_blank'; | $target = '_blank'; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 98 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0