fix: `/:initialTab?` is shown on the URL when opening note with some ways (#16353)

This commit is contained in:
anatawa12 2025-08-03 22:12:35 +09:00 committed by GitHub
parent aa10e537a5
commit 9273b21516
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -165,6 +165,8 @@ function buildFullPath(args: {
const replaceRegex = new RegExp(`:${key}(\\?)?`, 'g');
fullPath = fullPath.replace(replaceRegex, value ? encodeURIComponent(value) : '');
}
// remove any optional parameters that are not provided
fullPath = fullPath.replace(/\/:\w+\?(?=\/|$)/g, '');
}
if (args.query) {