From 70e03b8ae7cdc3ae45e2f40a0483d0a45001df8b Mon Sep 17 00:00:00 2001 From: Codeman maintainer Date: Tue, 13 Oct 2026 18:26:46 +0200 Subject: [PATCH] fix(preview): relative path links take m4v and ogv like rooted ones (#604/#606 integration) #606 added m4v and ogv to the rooted file-path link pattern for the new video uploads; #604's relative path pattern copies that extension list, and its test pins the two equal. The relative pattern now carries them too, so a relative `clip.m4v` links like `/home/u/clip.m4v`. Co-Authored-By: Claude Opus 5.5 (1M context) --- src/web/public/constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/web/public/constants.js b/src/web/public/constants.js index b9923e8d..12187ed8 100644 --- a/src/web/public/constants.js +++ b/src/web/public/constants.js @@ -2095,7 +2095,7 @@ function previewsInFileViewer(filePath) { * {@link findFilePathLinks}. */ const RELATIVE_FILE_PATH_LINK_PATTERN = - /(^|[\s"'`(\[{<>=,])((?![^\s"'`<>|;&()[\]{}=,\n\x00-\x1f]*:\/\/)(?:~\/|[^\s"'`<>|;&()[\]{}=,\/~\n\x00-\x1f])[^\s"'`<>|;&()[\]{}=,\n\x00-\x1f]*\.(?:log|txt|json|md|ya?ml|csv|xml|sh|py|tsx|ts|jsx|js|mjs|cjs|css|html|toml|ini|sql|png|jpe?g|gif|webp|avif|bmp|ico|svg|pdf|docx|pptx|xlsx|mp4|webm|mov|mp3|wav))\b/g; + /(^|[\s"'`(\[{<>=,])((?![^\s"'`<>|;&()[\]{}=,\n\x00-\x1f]*:\/\/)(?:~\/|[^\s"'`<>|;&()[\]{}=,\/~\n\x00-\x1f])[^\s"'`<>|;&()[\]{}=,\n\x00-\x1f]*\.(?:log|txt|json|md|ya?ml|csv|xml|sh|py|tsx|ts|jsx|js|mjs|cjs|css|html|toml|ini|sql|png|jpe?g|gif|webp|avif|bmp|ico|svg|pdf|docx|pptx|xlsx|mp4|webm|mov|m4v|ogv|mp3|wav))\b/g; /** The `(?:log|txt|…)` extension group, read off the rooted pattern so it cannot drift. */ const FILE_LINK_EXTENSION_GROUP = /\\\.(\(\?:[^()]*\))\)\\b$/.exec(FILE_PATH_LINK_PATTERN.source)[1];