Differential D25083 Diff 370 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 70 Lines • ▼ Show 20 Lines | if (!strlen($name)) { | ||||
$name = $link; | $name = $link; | ||||
$name = preg_replace('/^(?:mailto|tel):/', '', $name); | $name = preg_replace('/^(?:mailto|tel):/', '', $name); | ||||
} | } | ||||
if ($engine->getState('toc')) { | if ($engine->getState('toc')) { | ||||
return $name; | return $name; | ||||
} | } | ||||
$same_window = $engine->getConfig('uri.same-window', false); | $same_window = $engine->getConfig('uri.same-window', null); | ||||
if ($same_window === null) { | |||||
// TODO: | |||||
Lint: TODO Comment: This comment has a TODO. | |||||
// Instead of assuming every link as external, | |||||
// assume that only external links should be opened | |||||
// externally. This still probably creates lot of | |||||
// external links than needed, but less than before. | |||||
// https://we.phorge.it/T15161 | |||||
// $same_window = $this->isInternalGenericURI($link); | |||||
$same_window = false; | |||||
} | |||||
if ($same_window) { | if ($same_window) { | ||||
$target = null; | $target = null; | ||||
} else { | } else { | ||||
$target = '_blank'; | $target = '_blank'; | ||||
} | } | ||||
// For anchors on the same page, always stay here. | // For anchors on the same page, always stay here. | ||||
if ($is_anchor) { | if ($is_anchor) { | ||||
▲ Show 20 Lines • Show All 96 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
This comment has a TODO.