Add explcit aliases for open links

This commit is contained in:
2026-02-13 10:10:57 +01:00
parent 4dae370deb
commit 232802b0ce
4 changed files with 64 additions and 11 deletions

View File

@@ -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
}