Add explcit aliases for open links
This commit is contained in:
@@ -105,7 +105,21 @@ class syntax_plugin_luxtools_open extends SyntaxPlugin
|
||||
if (!preg_match('/^[a-zA-Z][a-zA-Z0-9+.-]*:/', $path)) {
|
||||
try {
|
||||
$pathHelper = $this->createPathHelper();
|
||||
$path = $pathHelper->mapToAliasPath($path);
|
||||
|
||||
// If the input itself uses a configured path alias (legacy syntax
|
||||
// like "alias/sub/path"), resolve it first so the emitted open
|
||||
// path uses the new client-side alias format "ALIAS>relative".
|
||||
$resolvedPath = $path;
|
||||
try {
|
||||
$pathInfo = $pathHelper->getPathInfo($path, false);
|
||||
if (isset($pathInfo['path']) && is_string($pathInfo['path']) && $pathInfo['path'] !== '') {
|
||||
$resolvedPath = $pathInfo['path'];
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
// keep original path as-is when it is not in configured roots
|
||||
}
|
||||
|
||||
$path = $pathHelper->mapToAliasPath($resolvedPath);
|
||||
} catch (\Exception $e) {
|
||||
// ignore mapping failures
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user